Topic : Date problems

Topic Archived This topic has been archived - replies are not allowed.


This question is not answered. "Helpful" answers available: 2 . "Solved" answers available: 1 .



            Permlink
            Replies : 14 - Pages : 1 - Last Post : Feb 9, 2008 9:48 PM by: ovasquez
PPM

Posts: 14
From: Venezuela
Registered: May 5, 2006
Date problems
Posted: Jan 21, 2008 9:35 AM
 

I apologize if this is not the right forum to ask for help on this issue.

I’ am a Mac user who lives in Caracas, Venezuela. Recently our Government changed the Country official time so we set the clock 30 minutes back.

In System Preferences I set Date & Time to Automatically: Apple Americas/US (time.apple,com) and Time Zone to Caracas, Venezuela. (VET). GMT -4:30

So far so good.

But now, when I visit some pages, (apple.com/startpage, some news sites, and others) they show the date one day ahead. Other sites look ok.

I would appreciate your help.

Best regards

G5, 1,8 Dual   Mac OS X (10.4.11)    

Kappy


Posts: 41,531
From: Tampa, FL (Vancouver, BC May-Aug)
Registered: Oct 5, 2001
Re: Date problems
Posted: Jan 21, 2008 10:05 AM   in response to: PPM
 

Web sites do not get the date and time from your computer. If a site is displaying the wrong information then you should notify the web master of that site. Perhaps they have not corrected their time and date routines to accommodate the changes in your country.

Mac Pro 2.66 Ghz; MacBook Pro C2D 2.33 Ghz; MacBook Pro 2.16 Ghz   Mac OS X (10.5.1)   Intel iMac C2D 17 "; MacBook 2.0 Ghz; 30 GB iPod Video (Black); iPod Nano 2 GB  
TopoTone


Posts: 1,540
Registered: Oct 30, 2003
Re: Date problems
Posted: Jan 21, 2008 10:17 AM   in response to: PPM
 

The web site you visit show their date and time, from that location. I just went to http://www.timeanddate.com/worldclock/city.html?n=22
It shows Jan 22, when in fact, my Mac's date shows Jan 21., because I am in North America. So, it appears that your Mac's date and time does not compensate, or alter it's own settings when viewing another countries web site.
To see a date ahead, or behind, your current Mac's date seems normal.
What do you think?

G5 2 gHz iMac / G4 1.67 15" PB / G4 MDD 1.25/ G3 iBook   Mac OS X (10.4.10)    
BDAqua


Posts: 43,215
Registered: May 14, 2006
Re: Date problems
Posted: Jan 21, 2008 11:05 AM   in response to: PPM
 

Interesting, can't replicate it here, but I'm on Panther at the moment, and besides the clock bein off a half hour from Caracas time, the Apple Startpage reports the right day... maybe I'll try it aain after Noontime!?

     
smithrj


Posts: 2,293
From: Manhattan and Upstate New York
Registered: Jul 13, 2007
Re: Date problems
Posted: Jan 21, 2008 11:18 AM   in response to: BDAqua
 

BD Aqua, I wrote you a post and they pulled it. I just wanted to say thank you for being so kind. You are really nice.

Ray

MacBook 2GB, 250 drive, Black W/clear case   Mac OS X (10.4.11)   iMac 4GB Memory, 750 GB Drive, Time Capsule, iPod Shuffle  

PPM

Posts: 14
From: Venezuela
Registered: May 5, 2006
Re: Date problems
Posted: Jan 21, 2008 5:43 PM   in response to: smithrj
 

Thank a lot to all you for your kindness.
My date and local time is January 21, 2008, 9:06 pm

I make a little survey and get:

Cnn.com January 22, 2008
Los Angeles Times January 21, 2008
The New York Times January 21, 2008
Washington Post January 21, 2008
Miami Herald January 22, 2008
BBC News January 22, 2008 (ok, is tomorrow in London)
apple.com/startpage/ January 22, 2008
finance.yahoo.com/ January 21, 2008
bloomberg.com January 21, 2008

I just went to http://www.timeanddate.com/worldclock/city.html?n=22
Selected my city and I get the right date and time.

I’m very confused :(

G5, 1,8 Dual   Mac OS X (10.4.6)    

Charles Minow


Posts: 3,428
Registered: Sep 16, 2000
Re: Date problems
Posted: Jan 21, 2008 7:14 PM   in response to: PPM
 

Hi--

I see what you're talking about.

It depends on how the web site is displaying the time. If the web site is using the clock on its server, you'll see the date and time correctly (assuming they have their server set correctly). But if they're using JavaScript in the browser to show the localized time (i.e., hopefully show the time at your location), it looks like JavaScript doesn't know how to react.

I've uploaded a page to my site that should show this difference.

When I go this page with my Mac's time zone set to Mountain Time, the server shows this:

Server time: Monday, 21-Jan-2008 19:48:51 MST
JavaScript Time: Mon Jan 21 2008 19:48:51 GMT-0700 (MST)
Time Zone offset: 420 minutes


The first time is the actual time at the server (it's in the Mountain time zone). The second time is from a JavaScript I put on the page. You can see the result if I leave the time zone on my Mac to Mountain time, which is my time zone.

Now, if I change the time zone on my Mac to Victoria, Seychelles (because it's halfway around the world and probably nice and warm there), here's what I get:

Server time: Monday, 21-Jan-2008 19:53:07 MST
JavaScript Time: Tue Jan 22 2008 06:53:07 GMT+0400 (SCT)
Time Zone offset: -240 minutes


Notice how the time from the server hasn't really changed, other than to show how long it takes me to type a couple sentences.

Here's where it gets interesting: if I change my time zone to Caracas, Venezuela, the JavaScript clock goes insane:

Server time: Monday, 21-Jan-2008 19:54:57 MST
JavaScript Time: Tue Jan 22 2008 22:24:57 GMT+1930 (WILDABBR)
Time Zone offset: -1170 minutes


Yikes! It says you're 19 and a half hours ahead of GMT. At first, I thought maybe the JavaScript interpreter in the browser was just confused about the time zone. But, really, since there's only 24 hours in a day, no place on Earth would be more than 12 hours or so ahead of GMT.

It's the JavaScript, too, because watch what happens if load the same page from my Mac (not visible to the internet, so you have to trust me). If my Mac is set to MT:

Server time: Monday, 21-Jan-2008 20:04:27 MST
JavaScript Time: Mon Jan 21 2008 20:04:27 GMT-0700 (MST)
Time Zone offset: 420 minutes


So far so good. Now, change the time zone on the Mac to Caracas:

Server time: Monday, 21-Jan-2008 22:35:57 VET
JavaScript Time: Tue Jan 22 2008 22:35:57 GMT+1930 (WILDABBR)
Time Zone offset: -1170 minutes


The OS is right, but the JavaScript time coming from the browser is off by 24 hours. And a little math bears this out: if you add the 4.5 hours you really are behind GMT to the 19.5 hours that the JavaScript thinks you are ahead of GMT, you get 24 hours. So that's where the discrepancy comes from.

I get this behavior in Safari, Camino, and Firefox, so it's in the JavaScript implementations in both programs. What would be very interesting is if someone running Windows or Linux set to Caracas' time zone went to that page and tried it. That would point to whether it's a bug in JavaScript on all platforms, or if it's a bug in some library on the Mac.

charlie

MacBook Pro   Mac OS X (10.4.11)  
BDAqua


Posts: 43,215
Registered: May 14, 2006
Re: Date problems
Posted: Jan 21, 2008 7:18 PM   in response to: Charles Minow
 

Fantastic work Charles! :-)

Was wondering about the Java Script angle myself, but you saved me.

     
PPM

Posts: 14
From: Venezuela
Registered: May 5, 2006
Re: Date problems
Posted: Jan 22, 2008 5:41 AM   in response to: BDAqua
 

Ecellent Charlie, thanks!!!

If I only read the news or browse in Apple pages the java “bug?” is not a big deal.
But what about visiting banks sites and make some kind of transactions with the bad date?

Best

G5, 1,8 Dual   Mac OS X (10.4.6)    

PPM

Posts: 14
From: Venezuela
Registered: May 5, 2006
Re: Date problems
Posted: Jan 22, 2008 4:21 PM   in response to: PPM
 

Hi Charles,

I tested on Windows XP running on Parallels after applying a Microsoft patch created to fix the Time Zone change for Venezuela, and the date and time works ok in Safari and IE7.

Do you think that Mac OS need a patch?

Best

G5, 1,8 Dual   Mac OS X (10.4.6)    

Charles Minow


Posts: 3,428
Registered: Sep 16, 2000
Re: Date problems
Posted: Jan 22, 2008 7:56 PM   in response to: PPM
 

But what about visiting banks sites and make some kind of transactions with the bad date?

Well, I think it would be a good idea to keep an eye on what dates your browser is showing. On the other hand, I doubt that a responsible banking site would use date information from your browser to handle transactions. They'd have no way of knowing if your clock was set correctly or not.

I quite often set my clock to some completely unrelated time to test programs and how they react, particularly around the change to and from summer time. So, while I'm sitting here in January on my computer, I might well have the clock set to some time in November or March. Admittedly I don't leave it way that often, but I could forget to change it.

charlie

MacBook Pro   Mac OS X (10.4.11)  
Charles Minow


Posts: 3,428
Registered: Sep 16, 2000
Re: Date problems
Posted: Jan 22, 2008 8:19 PM   in response to: PPM
 

I tested on Windows XP running on Parallels after applying a Microsoft patch created to fix the Time Zone change for Venezuela, and the date and time works ok in Safari and IE7.

Do you mean you used the beta Windows version of Safari and it was fine? That would be very interesting if that were the case. I wouldn't necessarily be surprised if IE7 worked OK. However, I think an even more interesting check would be what Firefox does on Windows.

Do you think that Mac OS need a patch?

Possibly, although as far as I can tell, the Mac OS itself is fine. I've written a program that allows you to display a clock in a time zone of your choosing. And it currently shows Caracas at GMT-0430, and gets the day right. There's nothing fancy about how it's doing the calculations: I just use the Cocoa calendar routines, so if the Mac OS was wrong, it would be wrong, too.

One thing does come to mind, though. Your posts say you're at version 10.4.6 of the OS. There were several fixes for time zone related changes somewhere around that number. So it's possible you might need to update to a newer version of the OS. On the other hand, I'm still seeing oddities and I'm on 10.4.11.

charlie

MacBook Pro   Mac OS X (10.4.11)  
PPM

Posts: 14
From: Venezuela
Registered: May 5, 2006
Re: Date problems
Posted: Jan 23, 2008 7:15 AM   in response to: Charles Minow
 

Hi Charlie,

Thanks again for your time and patience.

Firefox on Parallels show the right date and time.

As you can see in my first post I am on OS 10.4.11, somehow the settings changed.
When I went to “My Settings” to correct it, I notice that the Time Zone menu show Caracas, La Paz GMT-4:00 instead -4:30, so the sample date is right for the day, but 30 minutes ahead in that page.

Your nice app EarthTime shows the right date and time on my Mac. But…

In my wife’s Intel Core 2 Duo, OS 10.4.9 , with the same date and time settings that my G5, your EarthTime show VET -0400!!!

Crazy

Best

G5, 1,8 Dual   Mac OS X (10.4.11)    

Charles Minow


Posts: 3,428
Registered: Sep 16, 2000
Re: Date problems
Posted: Jan 23, 2008 8:44 AM   in response to: PPM
 

PPM wrote:
Firefox on Parallels show the right date and time.

Interesting. So there must be some kind of an interaction with the OS and the JavaScript.

As you can see in my first post I am on OS 10.4.11, somehow the settings changed.

Oop. I missed that.

When I went to “My Settings” to correct it, I notice that the Time Zone menu show Caracas, La Paz GMT-4:00 instead -4:30, so the sample date is right for the day, but 30 minutes ahead in that page.

That Time Zone menu is a Discussions server issue. Probably it just needs to be updated...

Your nice app EarthTime shows the right date and time on my Mac. But…

In my wife’s Intel Core 2 Duo, OS 10.4.9 , with the same date and time settings that my G5, your EarthTime show VET -0400!!!

That actually makes sense. The Caracas time zone was changed in 10.4.11. So that's why. I imagine if she updated to 10.4.11, it would show the correct time.

You can check to see if it's fixed by running this command in the Terminal app:

zdump -v /usr/share/zoneinfo/America/Caracas | grep 200

On my 10.4.11 system, I get this result:

/usr/share/zoneinfo/America/Caracas  Tue Jan  1 03:59:59 2008 UTC = Mon Dec 31 23:59:59 2007 VET isdst=0
/usr/share/zoneinfo/America/Caracas Tue Jan 1 04:00:00 2008 UTC = Mon Dec 31 23:30:00 2007 VET isdst=0

That shows the transition where you set your clock back a half an hour. I imagine your wife's Mac will not show anything until it's upgraded.

charlie

MacBook Pro   Mac OS X (10.4.11)  
ovasquez

Posts: 2
From: Caracas,Venezuela
Registered: Feb 9, 2008
Re: Date problems
Posted: Feb 9, 2008 9:48 PM   in response to: PPM
 

The problem is with JavaScript and Mac OS X with the current update of time zone information for Venezuela.

The problem appears in Tiger and Leopard with any Mozilla-based application as Firefox and Camino, including LateNight Software JavaScript OSA. Also the bug appears with WebKit-based (JavaScriptCore) browsers.

right date example: Sun Feb 10 2008 01:03:50 GMT-0430 (VET)
wrong date exaple: Mon Feb 11 2008 01:03:50 GMT+1930 (WILDABBR)

This code will give print the wrong date with Mozilla-based applications, and the right date in browsers that use JavaScriptCore

<script type="text/javascript">
document.write(Date());
</script>

This code will print the wrong day in any browser:

<script type="text/javascript">
var currentTime = new Date();
var day = currentTime.getDate();
document.write(day);
</script>

Mac Book 2GHz Intel Core Duo   Mac OS X (10.4.11)   2GB RAM