Output date format

View: New views
3 Messages — Rating Filter:   Alert me  

Output date format

by Barrie Selack-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How do you control the output date format. I'd like to have just 2009-01-01, but the default is 2009-11-01 16:51:33.203 EST

Thanks,
Barrie

The most important thing in communication is hearing What isn't being said.
Anonymous

Disclaimer: This e-mail message is intended only for the personal use of
the recipient(s) named above.  If you are not an intended recipient, you
may not review, copy or distribute this message. If you have received this
communication in error, please notify us immediately by e-mail and delete
the original message.

This e-mail expresses views only of the sender, which are not to be
attributed to Rite Aid Corporation and may not be copied or distributed
without this statement.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Output date format

by niall.gallagher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Yes you can override the DateTransform yourself. You will have to implement your own Matcher object yourself. If you look through the archives there is an explanation there.

Niall


Niall Gallagher
RBS Global Banking & Markets
Office: +44 7879498724  

-----Original Message-----
From: Barrie Selack [mailto:bselack@...]
Sent: 07 August 2009 14:40
To: simple-support@...
Subject: [Simple-support] Output date format

How do you control the output date format. I'd like to have just 2009-01-01, but the default is 2009-11-01 16:51:33.203 EST

Thanks,
Barrie

The most important thing in communication is hearing What isn't being said.
Anonymous

Disclaimer: This e-mail message is intended only for the personal use of the recipient(s) named above.  If you are not an intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify us immediately by e-mail and delete the original message.

This e-mail expresses views only of the sender, which are not to be attributed to Rite Aid Corporation and may not be copied or distributed without this statement.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july _______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
Authorised and regulated by the Financial Services Authority.
 
This e-mail message is confidential and for use by the
addressee only. If the message is received by anyone other
than the addressee, please return the message to the sender
by replying to it and then delete the message from your
computer. Internet e-mails are not necessarily secure. The
Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent.

Whilst all reasonable care has been taken to avoid the
transmission of viruses, it is the responsibility of the recipient to
ensure that the onward transmission, opening or use of this
message and any attachments will not adversely affect its
systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry
out such virus and other checks as it considers appropriate.

Visit our website at www.rbs.com

***********************************************************************************


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support

Re: Output date format

by jpkutner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Here is an example of what I use:

public class DateTransform implements Transform<Date> {

    @Override
    public Date read(String value) throws Exception {
        return new Date(Long.valueOf(value));
    }

    @Override
    public String write(Date value) throws Exception {
        return String.valueOf(value.getTime());
    }
}

With this Matcher passed to the Persister:

public class MyMatcher implements Matcher {

    @Override
    public Transform match(Class type) throws Exception {
        if (type == null) {
            return null;
        } else if (type.equals(Date.class)) {
            return new DateTransform();
        }
        return null;
    }
}

On Fri, Aug 7, 2009 at 9:33 AM, <niall.gallagher@...> wrote:

> Hi,
>
> Yes you can override the DateTransform yourself. You will have to implement your own Matcher object yourself. If you look through the archives there is an explanation there.
>
> Niall
>
>
> Niall Gallagher
> RBS Global Banking & Markets
> Office: +44 7879498724
>
> -----Original Message-----
> From: Barrie Selack [mailto:bselack@...]
> Sent: 07 August 2009 14:40
> To: simple-support@...
> Subject: [Simple-support] Output date format
>
> How do you control the output date format. I'd like to have just 2009-01-01, but the default is 2009-11-01 16:51:33.203 EST
>
> Thanks,
> Barrie
>
> The most important thing in communication is hearing What isn't being said.
> Anonymous
>
> Disclaimer: This e-mail message is intended only for the personal use of the recipient(s) named above.  If you are not an intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify us immediately by e-mail and delete the original message.
>
> This e-mail expresses views only of the sender, which are not to be attributed to Rite Aid Corporation and may not be copied or distributed without this statement.
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july _______________________________________________
> Simple-support mailing list
> Simple-support@...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
> ***********************************************************************************
> The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB.
> Authorised and regulated by the Financial Services Authority.
>
> This e-mail message is confidential and for use by the
> addressee only. If the message is received by anyone other
> than the addressee, please return the message to the sender
> by replying to it and then delete the message from your
> computer. Internet e-mails are not necessarily secure. The
> Royal Bank of Scotland plc does not accept responsibility for
> changes made to this message after it was sent.
>
> Whilst all reasonable care has been taken to avoid the
> transmission of viruses, it is the responsibility of the recipient to
> ensure that the onward transmission, opening or use of this
> message and any attachments will not adversely affect its
> systems or data. No responsibility is accepted by The
> Royal Bank of Scotland plc in this regard and the recipient should carry
> out such virus and other checks as it considers appropriate.
>
> Visit our website at www.rbs.com
>
> ***********************************************************************************
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Simple-support mailing list
> Simple-support@...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-support mailing list
Simple-support@...
https://lists.sourceforge.net/lists/listinfo/simple-support