| | |
csv, convert date, mysql, php
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
First you calculate a timestamp integer from the old date (that is the number of seconds from January 1, 1970 00:00:00 GMT to the old date).
Then you call the php function date() with a format string and pass in the timestamp. Like so:
See here for more information on using date format strings.
Then you call the php function date() with a format string and pass in the timestamp. Like so:
php Syntax (Toggle Plain Text)
$datestring = date("Y-m-d", $timestamp);
See here for more information on using date format strings.
First, you fetch the data from the csv file using fgetcsv. Its returns the value as an array. Access the array element where the date is stored and do as scru has mentioned.
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
![]() |
Other Threads in the PHP Forum
- Previous Thread: page by page
- Next Thread: DB Column contains commas
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white wordpress xml youtube






