![]() |
|
[C#] DateTime format - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C#] DateTime format (/showthread.php?tid=4877259) |
DateTime format - SIM-1809171 - Jun 23, 2015 Hey I'm using - Code FileInfo info = new FileInfo(Environment.CurrentDirectory + "/temp" + folder + "/" + filename);along with some FTP shit in order to compare two datetime stanps. However, the FTP class returns the datetime in string format. When I try convert, it always gives 23:00:00 as the time. (or something similar) Heres is the output - ![]() As you can see, its getting the date correct, but the time is all wrong. Cheers What can I do to sort this? * - Only3 - Jun 23, 2015 u get the LastAccessTime not the current * - SIM-1809171 - Jun 23, 2015 (Jun 23, 2015 05:06 AM)Only3 Wrote: u get the LastAccessTime not the current That's not the issue. I've tried with both. The issue is the timeStamp of the one. It's not correct because of the format. * - phrootoo - Jun 23, 2015 try ParseExact. You probably have an issue with the culture. https://msdn.microsoft.com/en-us/library/w2sa9yss(v=vs.110).aspx |