Welcome3
Ununokt
Dołączył: 16 Paź 2010
Posty: 655
Przeczytał: 0 tematów
Ostrzeżeń: 0/5 Skąd: England
|
Wysłany: Sob 17:11, 13 Lis 2010 Temat postu: ghd prices australia Grokking Drupal dates and tim |
|
|
I've run into a surprevolution amount of trouble trying to get time zones working properly in Drupal via the Date module. For instance, the date in the database might not align with the displayed date in the node, and when I go to edit the date in CCK, it displays yet another date. It's gotten so baneful evil that I've had nightmares where calendars are bludgeoning me with timestamps, complaining that I just don't understand them, why don't I understand...
The date module saves dates in UTC, which stands for Coordinated Universal Time. So, regardless of your server, location or personal preference,[link widoczny dla zalogowanych], when a date CCK field stores the date, it will offset it to match UTC. That manner that if you and I make a post at the same time, even if we're in different time zones the date in the database will be the same for both of us.
The CCK date field widobtain and it's output on a node potency reveal two deviateent things if you don't set the time zone setting in the CCK field. I set mine to match my site's so that I only have one variable to deviate later.
Depending on what you need to do, you might need to explicitly set your time zone in PHP. For example, in order to get the date() function to output the time in my set time zone, I had to use date_default_timezone_set('America/Boise'). I might be missing something here, or need to update the date module, but this toils for now.
Grokking Drupal dates and time zones Grokking Drupal dates and time zones Posted October 17th, 2008 by Chris
So I finally decided to dig a little deeper,[link widoczny dla zalogowanych], and it's actionually some simple stuff that I can summarize in a few bullet points:
Post został pochwalony 0 razy
|
|