/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Better Way of Setting the Date?

I live in the U.S. Central Standard Timezone, so naturally, my website follows CST. In one of my scripts, I use this:

[code=php]date_default_timezone_set(‘US/Central’);[/code]

to set the date accordingly before I insert it into my database. However, [URL=”http://www.php.net/manual/en/timezones.others.php”]on this page from php.net[/URL], it warns PHP users not to use any of those timezones except for UTC.

Is there a better way I can set the timezone to U.S. CST before I insert it into my database?

to post a comment
PHP

8 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiMar 03.2009 — Use whichever one fits best from this page.
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorMar 04.2009 — I've looked at that list before, but I don't have any idea which one of those is equal to CST?
Copy linkTweet thisAlerts:
@NogDogMar 04.2009 — "America/Chicago" should be fine for CST (CDT starting this Sunday!).
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorMar 04.2009 — "america/chicago" should be fine for cst (cdt starting this sunday!).[/quote]

cdt?
Copy linkTweet thisAlerts:
@NogDogMar 04.2009 — Daylight savings time starts the 2nd Sunday of March these days. So Central Standard Time will become Central Daylight Time this Sunday.
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorMar 04.2009 — Ah, okay. Sorry; I've just never heard the term CDT before.
Copy linkTweet thisAlerts:
@NogDogMar 04.2009 — EST -> EDT

CST -> CDT

MST -> MDT (Except in Arizona, which is MST all year long)

PST -> PDT
Copy linkTweet thisAlerts:
@Joseph_WitchardauthorMar 04.2009 — Thanks? Parents should never knock time spent on message boards; you learn so much from them:p
×

Success!

Help @Joseph_Witchard spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...