FileInfo and Coordinated Universal Time (UTC)

S

Smithers

The System.IO.FileInfo class provides us with a few properties that involve
time:
CreationTime
CreationTimeUtc
LastAccessTime
LastAccessTimeUtc
LastWriteTime
LastWriteTimeUtc

What is the difference between the Utc and "non Utc" versions of these
properties?

Just wondering which I should be going with.

I'm writing a utility that backs up files (copies them from production
servers to backup server). Part of the routine is to compare the last
date/time a file has been modified. So the LastWriteTime is apparently the
one to go with - but which version? Utc or non utc?

Thanks.
 
P

Peter Duniho

Smithers said:
[...]
I'm writing a utility that backs up files (copies them from production
servers to backup server). Part of the routine is to compare the last
date/time a file has been modified. So the LastWriteTime is apparently the
one to go with - but which version? Utc or non utc?

I would use the UTC version. UTC is Coordinated Universal Time,
basically the same as Greenwich Mean Time for most purposes.

If you know that the local times will always be returned using the same
timezone, you could probably get away with using that. But UTC will
always be comparable to each other, no matter what happens to the local
time (daylight saving, time zone change).

Pete
 
S

Smithers

Ahhh, very good. Thank you.


Peter Duniho said:
Smithers said:
[...]
I'm writing a utility that backs up files (copies them from production
servers to backup server). Part of the routine is to compare the last
date/time a file has been modified. So the LastWriteTime is apparently
the one to go with - but which version? Utc or non utc?

I would use the UTC version. UTC is Coordinated Universal Time, basically
the same as Greenwich Mean Time for most purposes.

If you know that the local times will always be returned using the same
timezone, you could probably get away with using that. But UTC will
always be comparable to each other, no matter what happens to the local
time (daylight saving, time zone change).

Pete
 
M

Michael Starberg

Smithers said:
Ahhh, very good. Thank you.

I think humankind should invent a really huge antigravity field,
hand out showels, go to work, and make the world flat.

And then we can all live in one realtime. No need for UTC =)

Just A Suggestion
- Michael Starberg
 
S

Smithers

What are you talking about? The world is flat. "They" gave us different time
zones to make us *think* it's not flat.

-S
 
M

Michael Starberg

Smithers said:
What are you talking about? The world is flat. "They" gave us different
time zones to make us *think* it's not flat.

-S

Aah. My Bad!
I kneel corrected.

- Michael Starberg
 

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