Re: Dealing with Dates

From: DrTebi (DrTebi_at_yahoo.com)
Date: 12/10/04


Date: Fri, 10 Dec 2004 20:12:16 +0100

On Fri, 03 Dec 2004 15:15:55 -0800, Carl Carpenter wrote:

> I'm writing an app where I want the user to be able to change a date
> on a record. Date field is 'TngDate'. I can pull the record from the
> mySql database, split it into day/month/year, put each in a drop down
> box. What I can't seem to do is collect the modified entries,
> reassemble them into a single variable and pass it on to the update
> script. I admit to being a newbie at this and most of my scripts
> (including this one) come from examples that I have found either on
> the 'Net or in books. The script below is the script I have so far.
> It's in an include file. I would appreciate any help.
>

[snip]
Whatever you do, from my experience I really recommend using timestamps
rather than dates. Just make the database field an integer like
time_stamp INT UNSIGNED NOT NULL

Then work from there. It's a lot easier to deal with PHP's date functions
when you have a timestamp, than trying to convert the database's date
fields etc.

DrTebi

 



Relevant Pages

  • Re: Windows Scripting - Timestamp, files, need help. :)
    ... I need to write a script in vbscript (I want to use ... checks to see what the timestamps are. ... and formatting it YYYYMMDDHHMM ... formatting each item in the array into the format YYYYMMDDHHMM ...
    (microsoft.public.scripting.vbscript)
  • subroutine references
    ... I'm working on yet another exercise from Intermediate Perl. ... were modified between the two timestamps. ... $stop variables in the script at large. ... When I run the script I get these error messages: ...
    (perl.beginners)
  • Re: Script help
    ... | And if the question was to tinker with a set of files ... be too many files to fit on a single command line? ... That the script calls ... Yes close timestamps are also an issue. ...
    (Fedora)
  • Re: script to copy file by timestamp
    ... This particular wheel has been invented some time ago in the ... While it is possible to do the same it VB Script, ... their timestamps"? ... Please clarify. ...
    (microsoft.public.windows.server.scripting)
  • Event Log Scripting
    ... Ultimately I want a script which will pull out only 'Error' entry logs from ... dtmStartDate.SetVarDate DateToCheck, CONVERT_TO_LOCAL_TIME ... same script against a server with a few hundred entries it hangs for a very ...
    (microsoft.public.windows.server.scripting)