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

Compare file times across TimeZones ?

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

"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.