• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 385
  • Last Modified:

UNIX Time stamp issues

I am using the unix time stamp for a time stamp for a remote tool. The issue is that the code below converts to be exactly two hours ahead of my real system time. Any ideas???

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim n As Double

        n = (My.Computer.Clock.LocalTime.UtcNow - New DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds

        MessageBox.Show("The time is" + My.Computer.Clock.LocalTime.ToString + ", file time: " + n.ToString)


    End Sub

Thanks,

Brad
0
bradbritton
Asked:
bradbritton
  • 2
1 Solution
 
Brian CroweCommented:
utcnow is zulu time or GMT time.  Try using my.computer.clock.localtime.now
0
 
Brian CroweCommented:
correction...

my.computer.clock.localtime
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now