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

    Join Date
    Oct 2013
    Posts
    2
    Rep Power
    0

    Spot a datetime filed


    I'm using Regexr, but I can't figure out how to spot this field with Regex

    Code:
    Oct-14-13 11:49:26 PDT
    I actually need it for a programming language called AutoHotkey, but it's not listed here, so I selected PHP which I also use. The regex part is the same in either case. Thanks!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2003
    Posts
    3,600
    Rep Power
    595
    Probably not possible with regex. However, you might look at this:

    find-date
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Originally Posted by gw1500se
    Probably not possible with regex.
    Wut? This is a classical task for a regex. It's also exactly what your library uses.

    Something like this:

    Code:
    (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)(?:-\d{1,2}){2} \d{1,2}(?:\d{2}){2} P(?:S|D)T
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  6. #4
  7. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    It's possible your field is only DISPLAYING that value, and is in fact a much different value in actuality. Does the raw data look like this?
    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.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    2
    Rep Power
    0
    Originally Posted by ManiacDan
    It's possible your field is only DISPLAYING that value, and is in fact a much different value in actuality. Does the raw data look like this?
    I hear, but in this case I was already working with the raw data. I'm going to use STR_TO_DATE to insert to a standard unix timestamp.
    Originally Posted by Jacques1
    Something like this:
    Code:
    (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)(?:-\d{1,2}){2} \d{1,2}(?:\d{2}){2} P(?:S|D)T
    Thanks!

IMN logo majestic logo threadwatch logo seochat tools logo