473,413 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

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 2585
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
1
by: jyoti | last post by:
I am new in asp. I have two html files. I like to write code to compare those two files. I like to show the difference as highlighted area. Example: File 1 contains: <html><body> Compare...
1
by: Anthony | last post by:
Here is a debate we have been having at work about the design of our timeclock database application. We have built an online timeclock system for companies to use to keep track of their employees...
9
by: Rich | last post by:
Thanks for the Help in my previous post. I've been working on this and it's almost what I want. I want to obtain the user's current age by comparing their date of birth (user inputs) to the...
16
by: michael | last post by:
Is it possible to get all href URLs contained in a unordered list and place them in an array? Or in fact two different arrays, differently named one for each <ul> group? <ul> <li><a...
13
by: Michael | last post by:
I would like to set the timezone of a thread to allow me to calculate the UTC time for data sourced from a number of time zones. Although this can be done in C and C++, I annot find how to do...
0
by: Sunit Joshi | last post by:
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...
27
by: Sanjay | last post by:
Hi All, I am using pytz.common_timezones to populate the timezone combo box of some user registration form. But as it has so many timezones (around 400), it is a bit confusing to the users. Is...
4
by: Roberto Mora | last post by:
I have not done programming in a very long time and what is worst, I never learned VB. Although my job does not require this knowledge, I cam across a problem that although it seemed simple it has...
12
by: glennanthonyb | last post by:
Hi The company I work for has finally woken up to data security on our field laptops. I'm writing something in C# that will allow remote deletion of sensitive data and I don't believe...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.