473,657 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2628
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.co m> wrote in message
news:8f******** *************** ***@posting.goo gle.com...
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.co m> wrote in message
news:8f******** *************** ***@posting.goo gle.com...
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*******@opto nline.net> wrote in message news:<YG******* *************@n ews4.srv.hcvlny .cv.net>...
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.co m> wrote in message
news:8f******** *************** ***@posting.goo gle.com...
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.co m> wrote in message
news:8f******** *************** ***@posting.goo gle.com...
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
3198
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 indeed also true for our language of choice, Python. Its file type allows some extraordinary convenient access like: for line in open("blah"): handle_line(line)
1
2115
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 Test</body></html> File 2 contains: <html><body> Compare Test modyfied</body></html> I like to make either the word "modyfied" highlighted or
1
2080
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 hours. In brief, an employee can clock in and clock out by loggin through the site. All of their work dates are recorded and the employeer can poll reports based on employees in/out times, calculate hours, mark the hours as paid etc. The issue...
9
3930
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 current date. I know how to get the Current Date but I'm not finding how to calculate the Current Date minus the User's Birthday.
16
4431
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 href="lemurs.html">Lemurs</a></li> <li><a href="chameleons.html">Chameleons</a></li> </ul> <ul>
13
7020
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 this is C#. Can this be done ? If so how ? Please note setting the culture does not impact the timezone and a culture (like en-US) may have many timezones.
0
301
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 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
27
5310
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 there a smaller and more practical set? If not, some suggestions on how to handle the registration form effectively would help me a lot. thanks Sanjay
4
2417
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 become a nightmare. There is a log that gets generated in a regular basis and need to put most , but not all its contents in a DB (new or existent, it doesn't matter). because the fields that I need to cover are vertically and there is junk in...
12
4708
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 File.Delete() will be sufficient. Is there anything in .NET that removes any remanence of the file? If it isn't going to be easy, does anyone know of a component that I can hook into to do the dirty work, free of otherwise?
0
8399
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8312
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8504
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8606
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6169
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4159
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2732
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.