Forum Discussion

s_sakthivel's avatar
s_sakthivel
Occasional Contributor
10 years ago
Solved

How to convert date of any format to specified format

Function written doen't give unique output when running in different pc's due to different date format in different PC's.



dat = aqConvert.DateTimeToFormatStr(aqDateTime.Today, "%d%m%Y%H%S")

Tim = right(aqConvert.DateTimeToStr(time),8)

ChoCheqNo=Left((replace(Tim,":","")+dat),14)
  • Hi,



    Not sure what you are asking for...



    > dat = aqConvert.DateTimeToFormatStr(aqDateTime.Now, "%d%m%Y%H%S")

    This will work on any machine because .Now returns date/time as a standardized float value.



    You must know format if date/time is presented as a string.

    Otherwise it is not possible to determine whether, say, "01-02-03" is

    -- Jan 02, 2003 or

    -- Feb 01, 1903 or

    -- Mar 02, 2001 or

    -- ...

2 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi,



    Not sure what you are asking for...



    > dat = aqConvert.DateTimeToFormatStr(aqDateTime.Now, "%d%m%Y%H%S")

    This will work on any machine because .Now returns date/time as a standardized float value.



    You must know format if date/time is presented as a string.

    Otherwise it is not possible to determine whether, say, "01-02-03" is

    -- Jan 02, 2003 or

    -- Feb 01, 1903 or

    -- Mar 02, 2001 or

    -- ...