By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,218 Members | 1,257 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,218 IT Pros & Developers. It's quick & easy.

Convert today's date and time to a long

P: n/a
Hi I have to convert am today's date and time (now) to a webservice.
The example the web service gives was "1163313527144#" which comes out
to 12/31/1969 06:00 PM. How do I convert a date to a 13 digit long
value?

Nov 29 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a

Holmsey wrote:
Hi I have to convert am today's date and time (now) to a webservice.
The example the web service gives was "1163313527144#" which comes out
to 12/31/1969 06:00 PM. How do I convert a date to a 13 digit long
value?
what format is that? There are lots of ways to represent a date as a
long value...

--
Tom Shelton

Nov 29 '06 #2

P: n/a

Tom Shelton wrote:
Holmsey wrote:
Hi I have to convert am today's date and time (now) to a webservice.
The example the web service gives was "1163313527144#" which comes out
to 12/31/1969 06:00 PM. How do I convert a date to a 13 digit long
value?

what format is that? There are lots of ways to represent a date as a
long value...

--
Tom Shelton
Im am trying to figure out todays date as a long value from (A
millisecond value that is an offset from the Epoch, January 1, 1970
00:00:00.000 GMT (Gregorian).)

Nov 29 '06 #3

P: n/a

Tom Shelton wrote:
Holmsey wrote:
Hi I have to convert am today's date and time (now) to a webservice.
The example the web service gives was "1163313527144#" which comes out
to 12/31/1969 06:00 PM. How do I convert a date to a 13 digit long
value?

what format is that? There are lots of ways to represent a date as a
long value...

--
Tom Shelton
Im am trying to figure out todays date as a long value from (A
millisecond value that is an offset from the Epoch, January 1, 1970
00:00:00.000 GMT (Gregorian).)

Nov 29 '06 #4

P: n/a

Holmsey wrote:
Tom Shelton wrote:
Holmsey wrote:
Hi I have to convert am today's date and time (now) to a webservice.
The example the web service gives was "1163313527144#" which comes out
to 12/31/1969 06:00 PM. How do I convert a date to a 13 digit long
value?
what format is that? There are lots of ways to represent a date as a
long value...

--
Tom Shelton

Im am trying to figure out todays date as a long value from (A
millisecond value that is an offset from the Epoch, January 1, 1970
00:00:00.000 GMT (Gregorian).)
Ok... How 'bout:

Dim epoch As New DateTime (1970, 1, 1, 0, 0, 0, 0)
Dim diff As TimeSpan = DateTime.Now.Subtract (epoch)
Dim ms As Long = CType (diff.TotalMilliseconds, Long)
Console.WriteLine (ms)

Nov 29 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.