#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    51
    Rep Power
    3

    How to i convert a php date to unix timestamp


    Hello everyone

    i am having trouble converting my dates into a UNIX Timestamp.

    the dates come in this format :

    31- Dec-2012

    i would now like to convert this date into a UNIX timestamp. i tried several methods but each one gave me an incorrect date.

    thank you very much for your assistance.

    warm regards


    Andreea 115
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,470
    Rep Power
    594
    What method did you try? I would think 'strtotime' could handle that.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6351
    Code:
    php > echo date('c', strtotime('31- Dec-2012'));
    2012-12-31T00:00:00-05:00
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2012
    Posts
    51
    Rep Power
    3
    Originally Posted by ManiacDan
    Code:
    php > echo date('c', strtotime('31- Dec-2012'));
    2012-12-31T00:00:00-05:00
    thank you for your help everyone. i resolved the issue.

    i really appreciate the kind advice
    warm regards

    Andreea115

IMN logo majestic logo threadwatch logo seochat tools logo