SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 29
  1. #1
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,529
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Choosing a Date Format...

    What Date Format should I choose for my Private Messages?

    (Since I'm in the U.S., answers from an American perspective are preferred, but all welcome!!)


    Currently I am using this...
    Code:
    DATE:  2013-12-28 12:25:18

    I started using such a format about 7-8 years ago, because it is *logical*.

    Unfortunately, most End-Users are not logical, so what would be a better format?


    The context is what you'd see when you open up a PM...

    Code:
    FROM:
    
    TO:
    
    DATE:
    
    SUBJECT:
    Sincerely,


    Debbie

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,600
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    I'd let them choose the format for themselves - that's what most CMS do. You just provide them with one field in their profile for entering their desired format and then use that to determine which format to display the date in for them.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,444
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)
    I feel comfortable using 2 formats eg.
    Dec. 31, 2013 for dating checks, letters, etc.(or 12-31-13 for personal use as I know what I mean by it)
    yyyy-mm-dd-hh-mm-ss for code as that tends to make things easier to work with eg. sorting

    I can usually figure out different formats, the only time I usually get confused is when day and month are both expressed as numbers and I'm not sure if 5 10 means May 10 or Oct 5

    But yes, different cultures do use different formats so giving users an option would be best if possible.

  4. #4
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,529
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    I'd let them choose the format for themselves - that's what most CMS do. You just provide them with one field in their profile for entering their desired format and then use that to determine which format to display the date in for them.
    Interesting idea, but more complicated than you think...

    If every Date was in a wide open space like in a Private Message, your idea would be fairly easy to implement.

    But think of all the times where you have tight spaces, tables, columns, abbreviations (e.g. Feb 2014) and so on...

    I'm sure there is a way to address all of those situations, but much more thinking would be involved than you are implying!

    Nonetheless, a good idea to consider.


    Back to my OP though...

    What format would be the most tolerable for my Private Messages?

    Would your average user be able to figure out...
    Code:
    DATE: 2013-12-05 07:31:05
    or

    Code:
    2013-12-15 18:45:00
    Sincerely,


    Debbie

  5. #5
    Barefoot on the Moon! silver trophy
    Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,516
    Mentioned
    51 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    What format would be the most tolerable for my Private Messages?

    Would your average user be able to figure out...
    Code:
    DATE: 2013-12-05 07:31:05
    or

    Code:
    2013-12-15 18:45:00
    The average user will get confused when using the timecode/timestamp or European style date format. Most have never seen it before.

    For everything that happens behind the scenes in the code and your database, the standard timestamp is the way to go. When you present the date to the user, just format it as the standard mm/dd/yy 99:99am/pm or let the user choose.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  6. #6
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,529
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Force Flow View Post
    The average user will get confused when using the timecode/timestamp or European style date format. Most have never seen it before.

    For everything that happens behind the scenes in the code and your database, the standard timestamp is the way to go. When you present the date to the user, just format it as the standard mm/dd/yy 99:99am/pm or let the user choose.
    It's lonely being a geek!!


    What do you think about adding the Day?


    If so, what combined format for Jane-user?

    Sincerely,


    Debbie

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,600
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Well you can get away with 1/1/14 for today - just about everyone will recognise that. Most of the world expects tomorrow to be 2/1/14 while a small minority expect tomorrow to be 1/2/14. Those who expect tomorrow to be 14-1-2 should be able to figure out 2/1/14 so it is only those who jumble the order and write the date as if each day consists of 12 months who will be confused by 2/1/14.

    So as a minimum if you want to display it as all numbers you'd need to offer two alternatives - d/m/y and m/d/y - otherwise you will have a large group reading it wrong.

    If you are going to use only one format I'd go with 2 Jan 14 as that should be clear to everyone.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  8. #8
    Keep Moving Forward gold trophysilver trophybronze trophy
    Shaun(OfTheDead)'s Avatar
    Join Date
    Nov 2005
    Location
    Trinidad
    Posts
    3,727
    Mentioned
    43 Post(s)
    Tagged
    0 Thread(s)
    My personal preference is this:
    01/Jan/2014

    I don't know specifically what you're asking about, but in everything I do written, I write the date that way. It's so frustrating doing accounts and having some receipts with the 'US format' and others with the 'UK format' because months and dates are just numbers and you can't tell which is which until you have big errors staring you in the face. I hate it, hate it, hate it! argh!

    For all my computing, I use DD's format:
    yyyy-mm-dd
    because it allows all of my folders to be listed in chronological order.
    Trying to fill the unforgiving minute
    with sixty seconds' worth of distance run.

    Update on Sitepoint's Migration to Discourse

  9. #9
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,444
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)
    I was justy thinking, probably a carry-over from roots in English Law, but here legal documents are like day-monthname-year
    This ___ day of ___ in the year ___

  10. #10
    Barefoot on the Moon! silver trophy
    Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,516
    Mentioned
    51 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by felgall View Post
    Well you can get away with 1/1/14 for today - just about everyone will recognise that. Most of the world expects tomorrow to be 2/1/14 while a small minority expect tomorrow to be 1/2/14. Those who expect tomorrow to be 14-1-2 should be able to figure out 2/1/14 so it is only those who jumble the order and write the date as if each day consists of 12 months who will be confused by 2/1/14.
    The US uses the month/day/year format. It tends to confuse people here when they see day/month/year.

    http://en.wikipedia.org/wiki/Date_format_by_country


    To make sure everyone understands the date, usually writing out the month makes the date clear no matter in which order everything is displayed, such as: January 1, 2014.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  11. #11
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,529
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Shaun(OfTheDead) View Post
    For all my computing, I use DD's format:
    yyyy-mm-dd
    I started using that format in maybe 2005 because it is *logical* when you go from GENERAL to SPECIFIC. (It is the way most of the world is already set up...)

    But your average person (and user) is a dope!!

    Based on everyone's responses, I can see I'm going to have to chew on things for a while.

    And while I like Felgall's idea, this is why I will *never* get my website done!!!! (Perfection is a b tch)


    Just for my Private Messages, how does this format look...
    Code:
    DATE:    Saturday, Dec 28, 2013 @ 12:24:10 pm


    Or I could do...
    Code:
    DATE:    Sat, Dec 28, 2013 @ 12:24:10 pm

    Or this...
    Code:
    DATE:    Sat, December 28, 2013 @ 12:24:10 pm
    Sincerely,


    Debbie

  12. #12
    Keep Moving Forward gold trophysilver trophybronze trophy
    Shaun(OfTheDead)'s Avatar
    Join Date
    Nov 2005
    Location
    Trinidad
    Posts
    3,727
    Mentioned
    43 Post(s)
    Tagged
    0 Thread(s)
    Has anyone ever accused you of being indecisive?
    Trying to fill the unforgiving minute
    with sixty seconds' worth of distance run.

    Update on Sitepoint's Migration to Discourse

  13. #13
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,444
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)
    Don't let perfection get in the way of progress (one of my faults I often still struggle with).

    IMHO you are probably over-thinking this one.

    If you don't want to store the datetime as a timestamp and let users choose a format, then I think as long as you show the month as text not numeric, and the full 4 digit year, users will have no problem with it and probably give it little, if any, thought.

    As for weekdays, those are only relatively important when recent. Little difference between Tue and Wed when months ago.

  14. #14
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,529
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Shaun(OfTheDead) View Post
    Has anyone ever accused you of being indecisive?
    Indecisive?

    I don't know...

    Can I get back to you on that later?

    What do you mean by that?

    Can you give me a few examples?

    Do you think I should change?

    I'm not sure...


    Debbie

  15. #15
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,529
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mittineague View Post
    Don't let perfection get in the way of progress (one of my faults I often still struggle with).
    Let me let you in on a little secret... (Just among friends!)

    By the end of 2014 I expect to have this fabulous new idea finally done.

    It is "cutting-edge", and certain to make me rich beyond belief!!!

    The world will be a better place because of this, and I'm sure to go down in history...

    It is this round thing that I refer to as "The Wheel"!

    (Promise not to tell anyone, right?!)


    Quote Originally Posted by Mittineague View Post
    IMHO you are probably over-thinking this one.
    I've been known to do that - along with being "indecisive"...


    Quote Originally Posted by Mittineague View Post
    If you don't want to store the datetime as a timestamp and let users choose a format, then I think as long as you show the month as text not numeric, and the full 4 digit year, users will have no problem with it and probably give it little, if any, thought.
    For a Private Message, I like the format I posted above...
    DATE: Thursday, Jan 2, 2014 @ 8:40:57 am

    I also really like Felgall's idea of letting Users customize the format!! (But as mentioned, that is quite a bit more involved as it affects things system-wide. A nice-to-have for v3.0...)


    Quote Originally Posted by Mittineague View Post
    As for weekdays, those are only relatively important when recent. Little difference between Tue and Wed when months ago.
    Good point.


    Off Topic:


    Now THERE would be a cool PHP Function...

    It shows the DAY when a DATE is less than, say, 2 weeks old, but after that changes to a Non-Day Date!!


    Sincerely,


    Debbie

  16. #16
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,600
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    I also really like Felgall's idea of letting Users customize the format!! (But as mentioned, that is quite a bit more involved as it affects things system-wide. A nice-to-have for v3.0...)
    Not all that difficult if you are using PHP and mySQL.

    All your dates will need to be CCYY-MM-DD to insert into the database and you can easily use either language to retrieve dates in ANY format from the database.

    For example to do it inside the SELECT statement simply have their profile give them the option to choose a date format:

    Code:
    <select name="dateformat">
    <option value="%d/%m/%Y">dd/mm/yyyy</option>
    <option value="%m/%d/%Y">mm/dd/yyyy</option>
    <option value="%Y-%m-%d">yyyy-mm-dd</option>
    </select>
    Then in the select statement when you reference a date field (eg, dbdate) use:

    SELECT DATE_FORMAT(dbdate,$dateformat) FROM ...
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  17. #17
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,529
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Not all that difficult if you are using PHP and mySQL.
    Come on... It is a MAJOR DEAL, because it requires me to go through about 20,000 lines of code and make sure that Dates get implemented properly both from a backend PHP/MySQL standpoint, as well as, from a UI standpoint.

    Definitely something I'll consider for v3.0, but not for now.

    Sincerely,


    Debbie

  18. #18
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,600
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    Come on... It is a MAJOR DEAL, because it requires me to go through about 20,000 lines of code and make sure that Dates get implemented properly both from a backend PHP/MySQL standpoint, as well as, from a UI standpoint.
    So does deciding on using ONE specific date format for everyone. The difference in the amount of work to change from one date format to another specific date format compared to changing from one format to a user selectable format is a couple of dzen lines of extra code. The actual checking throughout the entire application to find all the dates is just as necessary for changing to one particular format. That you asked the question in the first place means you have to at least do 99% of the work to switch to user selectable formats anyway.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  19. #19
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,529
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    So does deciding on using ONE specific date format for everyone. The difference in the amount of work to change from one date format to another specific date format compared to changing from one format to a user selectable format is a couple of dzen lines of extra code. The actual checking throughout the entire application to find all the dates is just as necessary for changing to one particular format. That you asked the question in the first place means you have to at least do 99% of the work to switch to user selectable formats anyway.
    I see your point, but I think you miss mine...

    I was just asking what format people thought was best for my Private Messages. (The logic being, the Date is a little more "in your face" when you are looking at a PM. In a lot of other parts of my website, Users probably don't even notice the dates...)

    So, yes, the effort to switch *all* Dates to FORMAT_123 and the extra effort to allow people to customize *all* Dates to FORMAT_OF_CHOICE is minimal.

    I agree.

    And, I agree that your idea of letting people customize things is a good idea.

    I'm just saying neither will happen this build.

    But as a sloppy consolation prize, you guys can help me pick the best Date Format for *just* my Private Messages!

    Based on the conversation so far, I've got some ideas.

    Sincerely,


    Debbie

  20. #20
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,529
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    P.S. In addition, while I get what you are saying about the effort required to hunt things down, I think the effort to code "customization" is harder than you might think.

    The way I envision things is that there would be a "family" of Date Formatting styles.

    For example, if you chose "American", then Dates would be formatted into one of the following formats depending on the situation...

    Code:
    1/2/2014
    
    Jan 2, 2014
    
    Thursday, Jan 2, 2014
    
    01-02-2014

    Doing things that way - which is the "right way" in my opinion - would take much more of an effort, although time well spent!

    Just my 2-cents...

    Sincerely,


    Debbie

  21. #21
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,578
    Mentioned
    62 Post(s)
    Tagged
    3 Thread(s)
    Off Topic:

    Debbie, it is the start of the New Year so how about applying the DRY(don't repeat yourself) principle to this task?

    Try creating a date function that:
    1. accepts your common date data.
    2. checks to see if the user has set a preferred date format
    3. defaults to your preferred date format.
    4. returns the formatted date.

    This should drastically reduce the 20,000 lines of code.

  22. #22
    SitePoint Evangelist silver trophybronze trophy
    Join Date
    Jul 2013
    Posts
    406
    Mentioned
    21 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:


    Quote Originally Posted by DoubleDee View Post
    Let me let you in on a little secret... (Just among friends!)
    By the end of 2014 I expect to have this fabulous new idea finally done.
    It is "cutting-edge", and certain to make me rich beyond belief!!!
    The world will be a better place because of this, and I'm sure to go down in history...
    It is this round thing that I refer to as "The Wheel"!
    (Promise not to tell anyone, right?!)
    Too late! I already invented "The Wheel " in 2009-11-15 14:00:59.

    • Inventions > The Wheel

      (more or less English translation)
      (rest of the tutorial not in English / not complete online at the moment)


    =======
    KISS: the easy dating way!
    An alternative for difficult date configuration operations could be:
    • Set the date in the format which is the easiest fitting for the system operations.
    • Tell the visitor with a hoverable questionmark what format is used.

    Then you can do what you like.

    Note: to be complete, also the time zone and/or the AM/PM notation could be mentioned.

  23. #23
    Non-Member
    Join Date
    Dec 2013
    Location
    dhaka
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    choosing a date format is very important.i use this date format like as -year.month.day

  24. #24
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,444
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)
    Of course if you really want to accomodate all users, such as those that use the Islamic or Jewish calendars etc. you should consider using Unix timestamp - a long integer containing the number of seconds between the Unix Epoch (January 1 1970 00:00:00 GMT) and the time specified - and corresponding converter classes

  25. #25
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,529
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Mittineague View Post
    Of course if you really want to accomodate all users, such as those that use the Islamic or Jewish calendars etc. you should consider using Unix timestamp - a long integer containing the number of seconds between the Unix Epoch (January 1 1970 00:00:00 GMT) and the time specified - and corresponding converter classes
    I know what the Unix Timestamp is, but you lost me on how that relates to Islamic and Jewish Calendars?


    Debbie


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •