Berkeley CSUA MOTD:Entry 36497
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2024/11/23 [General] UID:1000 Activity:popular
11/23   

2005/3/2-3 [Computer/SW/Database] UID:36497 Activity:high
3/2     Lets say you are running a website connected to a database.  The
        website stores all sorts of time sensative info in the database,
        like order timestamps, keeping track of various states of stuff,
        etc.  When we go on or off daylight savings time, doesn't that totally
        mess up things that deal with spans of time? How do you deal with that?
        And how do you display things to the user when they happen right around
        the switch-over?  How about people living in regions like Arizona or
        Hawaii, who don't have daylight savings time?
        \_ Your server needs to have a notion of timezone. Certainly it
           should know its own, and most likely that of its users as well (if
           it doesn't, the users are much more likely to be confused by
           consistently wrong-timezone timestamps than by the 2-hours-a-year
           DST problem). Once it does, you should store dates internally
           either in a timezone-insensitive format (read the time(3) manpage,
           i.e. "man 3 time"), or in a timezone-sensitive format with the
           timezone stored as well (although the former is recommended).
           The standard notion of timezone encodes the DST status as well.
           If you store dates in GMT, GMT is completely DST-free. If you store
           them in, say, Pacific, it will have timezone PST for normal time
           and PDT for daylight saving time. So the date that gets displayed
           as "Sun Apr  3 01:18:19 PST 2005", and is stored internally as
           1112519899, is one hour earlier than the date displayed as
           "Sun Apr  3 03:18:19 PDT 2005" and stored internally as 1112523499.
           This is obvious when you deal with the internal representations:
           1112523499-1112519899=3600. -alexf
          \_ UTC
                \_ I guess my related question was, what if someone changes the
                   the time back 1 hour ... Or on a real server would no one
                   do that ever.
                   \_ Use UTC for everything. Use NTP to keep it synchronized.
                      UTC only changes by one leap second every few years.
            \_ Gah, fine, UTC, not GMT, I stand corrected. Nitpickers. -alexf
               \_ If, for some reason, you want to know a *lot* more about
                  the history of UTC, GMT and precision time keeping in general,
                  you might enjoy reading "Splitting the Second", by Tony Jones.
        \_ In practice, you don't have to worry about this.  Use your database
           server's native DATETIME (mysql) or TIMESTAMP (everyone else) data
           type.  Store the current time using SYSDATE (oracle) or NOW()
           (everyone else).  When you access it formatted, you'll get it
           in the local time format.  So you have to worry about fucking with
           your clock, by not about changing time zones.
2024/11/23 [General] UID:1000 Activity:popular
11/23   

You may also be interested in these entries...
2011/12/20-2012/2/6 [Politics/Foreign/Asia/China, Computer/Rants] UID:54268 Activity:nil
12/20   A higher percentage of people in China than in Pakintan have an
        unfavorable view of China:
        http://www.pewglobal.org/database/?indicator=24&response=Unfavorable
        Go figure.
        \_ damn these self critical liberals!
	...
2011/11/27-2012/1/10 [Computer/HW/Drives] UID:54244 Activity:nil
11/27   CalMail has been down for a few days (hardware failure and database
        corruption -- sounds like fun!) and is starting to come back online.
        Looks like they're planning to outsource all campus mail to either
        Google Apps or Microsoft 365 as part of Operational Excellence.
        <DEAD>kb.berkeley.edu/jivekb/entry!default.jspa?externalID=2915<DEAD>
        \_ http://ist.berkeley.edu/ciocalmailupdates/november-30-2011
	...
2009/10/27-11/3 [Computer/HW/Drives] UID:53474 Activity:nil
10/27   I just read an article that Facebook had moved their database
        to all SSD to speed throughput, but now I can't find it. Has
        anyone else seen this? Any experience with doing this? -ausman
        \_ I hope you're not running mission critical data:
           http://ask.slashdot.org/story/09/10/27/1559248/Reliability-of-PC-Flash-SSDs?from=rss
        \_ Do you have any idea how much storage space is used by Facebook,
	...
2009/9/23-10/5 [Computer/SW/Database] UID:53392 Activity:nil
9/23    I never took CS188, is there a good book that's an intro to formal
        database theory, normalization, etc.?  I've got experience with SQL
        (MySQL & MSSQL), and understand tables, etc.
        \_ You mean CS186?
           \_ Oops, yah.  188 is AI or something?
              \_ That's right.
	...
2009/9/10-15 [Computer/SW/Database] UID:53357 Activity:moderate
9/9     Larry Ellison is a bigger idiot than I thought:
        http://www.techcrunch.com/2009/09/10/oracle-to-sun-customers-and-ibm-were-in-it-to-win-it
        \_ My company's customers are insurance companies. Non-tech corporates don't
           trust open source. Why risk it. They have tons at stake and are willing
           to spend for solid products, support, and consultants who don't have long
           hair. They're being raped by IBM mainframes for millions. An optimized
	...
2009/7/28-8/6 [Computer/SW/Database] UID:53213 Activity:nil
7/27    I have an actual technical question here. My MySQL DBA tells me
        that I can't expect a MySQL port to be able to run effectively
        on more than a two CPU box, he says that the extra CPUs will
        sit there unused. Is this true? I have a bunch of new quad core
        servers that I would like to use as Database machines. -ausman
   \_ It's not that simple.  If you stress test your new fancy multi core
	...
2009/7/26-29 [Computer/SW/Security] UID:53200 Activity:nil
7/25    so is this a remote ssh exploit ?
        http://users.volja.net/database/matasano.PNG
        \_ No but this is:
           soda> ssh anywhere
	...
2009/5/6-14 [Computer/SW/Languages/Perl, Computer/SW/Languages/Web] UID:52961 Activity:kinda low
5/6     I'm sure you've seen web sites that distribute software by making
        a user fill out a form and then e-mailing the user a randomly
        generate link to the software that works just once. What software
        is used to do this? I'd like to distribute software in such a way.
        \_ "Software"?  What web server/web application environment
           are you using?
	...
2009/5/5-6 [Computer/HW/Laptop] UID:52950 Activity:moderate
5/5     Is there a good (or standard) way to make an offline copy of a w
        ordpress blog (mine, not someone else's)? tia.
        \_ oh man.
           \_ I could cobble something together with curl / wget, but I'd
              rather not if there is a standard way of doing this.  I'm
              pretty new to wordpress / blogging and I just want to keep
	...
2009/3/30-4/3 [Computer/HW/Memory, Computer/HW/Drives] UID:52772 Activity:nil
3/30    CF/SD Disk database:
        http://robgalbraith.com/bins/multi_page.asp?cid=6007
	...