General information
Category:
Coding, syntax & commands
>I am running into an error trying to parse out the numbers from a date.
>My ulimate goal is to get the number 10042001 from 10/04/2001.
>my code:
>
>mydate = date()
>myfile = substr(alltr(str(mydate)),1,2)
>myfile = myfile + substr(alltr(mydate),4,2)
>myfile = myfile + substr(alltr(mydate),7,4)
>
>Can anyone point me in the right direction where I could solve this problem?
>Thanks >> Wes
If you are flexible to the date format you could just do this which will always return the format YYYYMMDD regardless of the SET CENTURY or SET DATE settings.
myfile = myfile + DTOS(date())
If you aren't flexible with the date format
myfile = myfile + STRTRAN(dtoc(DATE()),'/','')
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only