473,322 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

mktime help - Jan, Feb......

PHP doesn't have ENUM and I'm inputting the date 14-SEP-2003 and
I want to "insert into atable values ('2003-09-14', .........==> mysql.

Anybody have a neet trick?

Tks
Chuck

Jul 16 '05 #1
4 2120

On 15-Sep-2003, Cal Lidderdale <ch***@liderbug.com> wrote:
PHP doesn't have ENUM and I'm inputting the date 14-SEP-2003 and
I want to "insert into atable values ('2003-09-14', .........==> mysql.

Anybody have a neet trick?


$mysqldate = date('Y-m-d',strtotime('14-sep-2003'));

--
Tom Thackrey
www.creative-light.com
Jul 16 '05 #2
how does this problem concern ENUM?

strtotime() will return a timestamp... if it's a date column.. just
insert the timestamp..
'insert into atable values ('.strtotime('14-SEP-2003').',.........'

Cal Lidderdale <ch***@liderbug.com> wrote in message news:<Wx*****************@news.uswest.net>...
PHP doesn't have ENUM and I'm inputting the date 14-SEP-2003 and
I want to "insert into atable values ('2003-09-14', .........==> mysql.

Anybody have a neet trick?

Tks
Chuck

Jul 16 '05 #3
Tom Thackrey writes:
$mysqldate = date('Y-m-d',strtotime('14-sep-2003'));


Strtotime represents time as the number of seconds since Jan 1st 1970.
The upper limit is in 2038 I think. If you want to represent dates
outside of this range you can't use this method to format them.

--

__o Alex Farran
_`\<,_ Analyst / Programmer
(_)/ (_) www.alexfarran.com

Jul 16 '05 #4

On 16-Sep-2003, Alex Farran <al**@alexfarran.com> wrote:
Tom Thackrey writes:
$mysqldate = date('Y-m-d',strtotime('14-sep-2003'));


Strtotime represents time as the number of seconds since Jan 1st 1970.
The upper limit is in 2038 I think. If you want to represent dates
outside of this range you can't use this method to format them.


The year 2003 is well within the range ;-)

If you need dates outside the unix time stamp range try:
http://www.php.net/manual/en/ref.calendar.php

--
Tom Thackrey
www.creative-light.com
Jul 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: adam | last post by:
Hi all, I am having a problem with calculating a date. What I am looking to do is get the date of Sunday of this week, then use mktime() to find out other days in the past by subtracting days. ...
9
by: WebM¤nkey | last post by:
Hi folks Just found that the mktime function returns a negative value when the date is 26 march 2006 with 0 hours, 0 seconds and 0 minutes. Is this a documented problem ? Any suggestions ?
2
by: Bengt Richter | last post by:
Python 2.3.2 (#49, Oct 2 2003, 20:02:00) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> time.mktime((1969, 12, 31, 17, 0, 0, 0, 0, 0))...
2
by: Florian Quetting | last post by:
Hi, I'm getting mad with following problem: The code compiles, but I always get a segfault and I don't have any clue why. I can't see any differences in my way of calling mktime and others. ...
4
by: McBooCzech | last post by:
Hi, on Linux (Fedora FC4) and Python 2.4.1 I am trying to know the time delta in seconds between two times given in the HHMMSS format. My code looks like: import datetime, time...
1
by: KW | last post by:
Hi all, Appreciate if someone can help me out on this. Currently, I have a tm structure holding information of the UTC time, which is very likely to be in the past, meaning not the current...
16
by: John Hanley | last post by:
I created a function that breaks down a date into broken down time, I subtract a certain number of seconds from that, then use mktime() to recompute the calendar time. It works basically except...
2
by: John Hanley | last post by:
I am getting some inconsistencies with mktime(). I allocate memory for my struct tm early in my program, and assign only *some* of the member variables. t->tm_sec=s; t->tm_min=m;...
2
by: pedalpete | last post by:
I've got this error which keeps popping up, but I can't seem to figure out why. The error reads ' A non well formed numeric value encountered in filename on line <b>198</b>'. the lines...
5
by: Robert Latest | last post by:
Here's what happens on my Windows machine (Win XP / Cygwin) at work. I've googled a bit about this problem but only found references to instances where people referred to dates before the Epoch. ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.