UTC to DateTime

  • Thread starter Thread starter TDS
  • Start date Start date
T

TDS

Hi

I have a value like 1241103793 and want to convert it to DateTime, which
method do i use?

TIA
TDS
 
TDS said:
Hi

I have a value like 1241103793 and want to convert it to DateTime, which
method do i use?

What does the value mean? I can only guess that it's the number of
seconds since 1/1/1970 because

Dim dt = #1/1/1970# + TimeSpan.FromSeconds(1241103793)

returns 04/30/2009, 15:03:13, which seems to be a feasible value - but
still guessing. You can call

dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc)

afterwards. Otherwise it's unspecified.


Armin
 
Hi Armin

This is the Time specified by CISCO Call Data, it is specified as UTC, Maybe
your suggestion for conversion is correct.

TIA
TDS
 
Hi Armin

This is the Time specified by CISCO Call Data, it is specified as UTC, Maybe
your suggestion for conversion is correct.

TIA
TDS
 
Hi Armin

This is the Time specified by CISCO Call Data, it is specified as UTC,
Maybe
your suggestion for conversion is correct.

"UTC" is simply a timezone offset (of 0). It's not a binary time format.
The value you have has a specific format, and until you know what that
format is, your question can't be answered. You've have to consult the
Cisco documentation for that.

Once you've figured out the format and determined a correct conversion
from the integer to an actual DateTime value, then Armin's suggestion for
specifying the storage for that value will apply.

Pete
 
TDS said:
Hi

I have a value like 1241103793 and want to convert it to DateTime, which
method do i use?

I agree with Armin. After turning it into a proper date/time value, you can
then adjust it to the timezone of the user using the localization features
..NET offers. I would consult the Cisco technical documentation to ensure the
start date for the ticks is correct.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

********************************************************
| Think outside the box! |
********************************************************
 
Back
Top