Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date Format to yyyy-mm-dd
Message
From
02/05/2007 11:30:00
 
 
To
02/05/2007 11:17:22
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01221828
Message ID:
01221839
Views:
15
>my forms's date format is dd-mm-yyyy (set date italian dmy)
>Now, I want to show it in report as yyyy-mm-dd (in string format )
>How can I save the date format form dd-mm-yyyy into string format (yyyy-mm-dd)

Agnes,

Edward's suggestion is one way, another way is :
  PARAMETERS  pddate
  LOCAL lcReturn
  lcReturn = ""
  lcReturn = ALLTRIM(STR(YEAR(pddate))) + "-" ;
    + PADL(MONTH(pddate),2, "0") + "-"  ;
    + PADL(DAY(pddate),2,"0")
  ENDIF
  RETURN lcReturn
not tested, just changed from my code. Mine said no dashes in format YYYYMMDD.

HTH
Beth
Previous
Reply
Map
View

Click here to load this message in the networking platform