Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help WIth C# TTOC(datetime(),2) Equiv
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01273992
Message ID:
01274005
Views:
10
This message has been marked as the solution to the initial question of the thread.
This is untested but try:

string dateString = System.DateTime.Now.ToString("YYYYMMDDHHmmSS");

For further info: look at the DateTime.ToString() with custom formatting help topic.




>I need to include the whole datetime system value into a string but formatted in YYYYMMDDHHMMSS format, I'm sure this is really easy to do in C#...but I haven't found it yet. Hoping someone knows off the top of their head.
>
>
string DateString = System.DateTime.Now.ToString()
>
>Returns: 12/7/2007 11:33:55 AM
>
>How can I have it return a string in the same format as the vfp TTOC(DATETIME(),1)?
>
>Desired Result is: 20071207113355
>
>Thanks
>
>Kirk
State of Florida, DCF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform