UTC to DateTime

T

TDS

Hi

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

TIA
TDS
 
A

Armin Zingler

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
 
T

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
 
T

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
 
P

Peter Duniho

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
 
C

Cowboy \(Gregory A. Beamer\)

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! |
********************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top