Page 1 of 1

Regarding Date conversion

Posted: Mon Nov 30, 2009 10:23 am
by satishm
Hi,
Can some one assist in converting a date from one format to another.

eg:
Input Date : 2009-12-31 ( yyyy-mm-dd) data-type : Date

Output Required : 31-12-2009 ( dd-mm-yyyy) data-type : Date

Regards,
SatishM.

Posted: Mon Nov 30, 2009 10:30 am
by chulett
A date is a date, only date values in string fields have formats like you are showing. You can use "[]", the substring operators, to re-arrange the parts of those external dates or the StringToDate / DateToString functions.

Posted: Mon Nov 30, 2009 3:58 pm
by ray.wurlod
Dates do not have formats. Dates are stored in binary format.

Re: Regarding Date conversion

Posted: Mon Jan 10, 2011 4:40 am
by vishal_rastogi
satishm wrote:Hi,
Can some one assist in converting a date from one format to another.

eg:
Input Date : 2009-12-31 ( yyyy-mm-dd) data-type : Date

Output Required : 31-12-2009 ( dd-mm-yyyy) data-type : Date

Regards,
SatishM.
you can convert first date to string then and then again string to date

Posted: Mon Jan 10, 2011 8:31 am
by chulett
No reason for anything like that, if both the source and target are a "date" data type as (as noted) there are no format to dates, they are stored internally in binary. Now if only one end or the other is a Date or there are two Strings involved then those functions are the way to go.