469,610 Members | 1,554 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,610 developers. It's quick & easy.

Compare file times across TimeZones ?

Hello All

I'm trying to figure out how to do this the best way. Basically, I
need to compare DateTime of files across TimeZones. The situation is
like this:

1. I have a database say in Korea in which file-1 resides (in OS) and
I have stored the UTC of the file's modified time in the database.

2. Next I create a zip archive and send the file to US, where it's
unzipped as file-2 (but with same name) and the TimeZone info. is lost
since WinZip does not preserve that.

3. Now I also restore the same database in US which has file-1 UTC in
it.

So how do I compare the DateTime of file-2 with the DateTime in the
database ??
Do I convert the file-2 to UTC and then compare it, or do I need to do
this in the same TimeZone as file-1's; i.e Korean ??
thanks
Sunit
Nov 16 '05 #1
4 2394
Are you storing the time IN the database, or are you using the
date/timestamp on the file itself?

Michael C.

"Sunit Joshi" <sj****@ingr.com> wrote in message
news:8f**************************@posting.google.c om...
Hello All

I'm trying to figure out how to do this the best way. Basically, I
need to compare DateTime of files across TimeZones. The situation is
like this:

1. I have a database say in Korea in which file-1 resides (in OS) and
I have stored the UTC of the file's modified time in the database.

2. Next I create a zip archive and send the file to US, where it's
unzipped as file-2 (but with same name) and the TimeZone info. is lost
since WinZip does not preserve that.

3. Now I also restore the same database in US which has file-1 UTC in
it.

So how do I compare the DateTime of file-2 with the DateTime in the
database ??
Do I convert the file-2 to UTC and then compare it, or do I need to do
this in the same TimeZone as file-1's; i.e Korean ??
thanks
Sunit

Nov 16 '05 #2
Are you storing the time IN the database, or are you using the
date/timestamp on the file itself?

Michael C.

"Sunit Joshi" <sj****@ingr.com> wrote in message
news:8f**************************@posting.google.c om...
Hello All

I'm trying to figure out how to do this the best way. Basically, I
need to compare DateTime of files across TimeZones. The situation is
like this:

1. I have a database say in Korea in which file-1 resides (in OS) and
I have stored the UTC of the file's modified time in the database.

2. Next I create a zip archive and send the file to US, where it's
unzipped as file-2 (but with same name) and the TimeZone info. is lost
since WinZip does not preserve that.

3. Now I also restore the same database in US which has file-1 UTC in
it.

So how do I compare the DateTime of file-2 with the DateTime in the
database ??
Do I convert the file-2 to UTC and then compare it, or do I need to do
this in the same TimeZone as file-1's; i.e Korean ??
thanks
Sunit

Nov 16 '05 #3
The file datatime is stored as UTC in the database.

Sunit

"Michael C" <mi*******@optonline.net> wrote in message news:<YG********************@news4.srv.hcvlny.cv.n et>...
Are you storing the time IN the database, or are you using the
date/timestamp on the file itself?

Michael C.

"Sunit Joshi" <sj****@ingr.com> wrote in message
news:8f**************************@posting.google.c om...
Hello All

I'm trying to figure out how to do this the best way. Basically, I
need to compare DateTime of files across TimeZones. The situation is
like this:

1. I have a database say in Korea in which file-1 resides (in OS) and
I have stored the UTC of the file's modified time in the database.

2. Next I create a zip archive and send the file to US, where it's
unzipped as file-2 (but with same name) and the TimeZone info. is lost
since WinZip does not preserve that.

3. Now I also restore the same database in US which has file-1 UTC in
it.

So how do I compare the DateTime of file-2 with the DateTime in the
database ??
Do I convert the file-2 to UTC and then compare it, or do I need to do
this in the same TimeZone as file-1's; i.e Korean ??
thanks
Sunit

Nov 16 '05 #4

"Sunit Joshi" <sj****@ingr.com> wrote in message
news:8f**************************@posting.google.c om...
The file datatime is stored as UTC in the database.


If the file datetime for file-1 is stored as UTC in the database, then you
just need to convert the datetime of file-2 to UTC and compare. If you
decide to go with comparing them in Korean time, you'll need to do TWO
conversions - convert file-1 datetime from UTC to Korean time zone AND
convert file-2 datetime to Korean time zone. Since you're already using UTC
on one file, it's half the work to convert the datetime on one file. Either
way, make sure they're converted to the same time zone when you compare.

Michael C.
Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Hans-Joachim Widmaier | last post: by
9 posts views Thread by Rich | last post: by
13 posts views Thread by Michael | last post: by
reply views Thread by Sunit Joshi | last post: by
27 posts views Thread by Sanjay | last post: by
12 posts views Thread by glennanthonyb | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.