Re: Convert input to Unix Timestamp



Jerry Stuckle wrote:
eclipsme wrote:
Jerry Stuckle wrote:
eclipsme wrote:
What is the suggested best ways to accept a date in a form that will be input into a table as a timestamp? I only care about the year-month-day, not the time.

Thank you,
Harvey

Whatever format you is most convenient for the user. You can always massage the format internally before putting it in the database.

What commands are used to 'message the format'?

strtotime? date()?

Thanks,
Harvey

It entirely depends on the format you get your data in.

The problem is - you're asking the wrong question. The first question should be - "What is the most user-friendly way to get the date?". This answer can easily vary, depending on the rest of your page (and site).

Once you have that, your next question can then be "How do I convert this to a format which is acceptable by the database?".

Right, I see.

How would I cinvert this to a timestamp? 10/15/08
.



Relevant Pages

  • Re: [PhP - dB] About Formatting a Date Result
    ... In the MySQL database the field is set to date not timestamp as you ... foresight has stored a string date instead of a timestamp, ... and can format your date to that used, in the config files, for any user ...
    (php.general)
  • Re: Importing a timestamp
    ... Try importing it as text, then write an Update query to remove everything ... field to the table and write another Update query to populate the Date/Time ... I have set the advanced to be the correct date format. ... > can not get the timestamp to import. ...
    (microsoft.public.access.gettingstarted)
  • Re: [PHP] checking user input of MM-DD-YYYY
    ... Because I'm inserting it into MySQL as a date conversion from American ... All the more reason I would turn it into a timestamp or DateTime ... If you enter it in that format MySQL will get it right without regard ...
    (php.general)
  • RE: timestamp datatype
    ... You must tell Oracle what format your DATE or TIMESTAMP data is in, ... rather than the raw Oracle DATE or TIMESTAMP format. ...
    (perl.dbi.users)
  • Re: Need help with parsing a multilined log file into objects
    ... The timestamp is always in the same format ... would like to populate for each object. ... Is the timestamp ALWAYS in the SAME format? ... Please post the definition of the target object. ...
    (microsoft.public.dotnet.languages.vb)