Topic "vb.net GetFileInfo LastWriteTime in local time - need UTC"

Author Message
ScottyB

Guest


Hi I'm using vb.net to call Session.GetFileInfo(sPathFile).LastWriteTime.ToString("MM/dd/yyyy") and it's returning the time as my local time.

I need it to return UTC. All the solutions I found deal with the interface, but I need something I can call in code.




Thanks in advance
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26711
Location: Prague, Czechia
Use the DateTime.ToUniversalTime method:

Session.GetFileInfo(sPathFile).LastWriteTime.ToUniversalTime().ToString("MM/dd/yyyy")

https://msdn.microsoft.com/en-us/library/system.datetime.touniversaltime.aspx
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License