|
-
Feb 18th, 2024, 11:25 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Converting non-US date string to date object
I'm saving a date to a JSON file as a string using Date.Now.ToString & then reading it back in & converting to a date at startup using CDate(myDateStr) which works fine, except when somebody from a non-US country runs my app the date is written as "Thu 15 02 2024 22:38:32" & when I try to convert that string to a date I'm getting an error "String was not recognized as a valid DateTime." How can I make my code handle both a US format ("mm:dd:yy hh:mm:ss") & non-US format "Thu 15 02 2024 22:38:32"? Do I need to specify the format when I write it so it's always saved in a consistant format or is there a better way? Thanks...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|