473,396 Members | 2,011 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,396 software developers and data experts.

MySql date conversion to IST format

Hello
Here is date-field example in my php code:

<?php echo $record['datefield']; ?>

I get output result best in following format (2011-03-04 00:00 am)
But I would like to get following format (Friday 4 March, 2011 00:00 am)
I tried using this <?php echo date('l j F, Y. h:i a ', $record ['datefield'] strtotime +41400); ?>
Here, I used "strtotime" to convert from MySql time to Indian time.

But I did get result as following (Thursday 1 January, 1970. 05:30 am)

What can I do to get desired result?

Thanks in advance.
Mar 4 '11 #1
1 2090
Dormilich
8,658 Expert Mod 8TB
you need to pass the correct timestamp. that is, use strtotime() on the date only.
Mar 4 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Noyb | last post by:
How do I convert a string into a value I can upload to mysql date field. Specifically, I have a user select a month, day and year from drop-downs, then I want them submitted to one date field....
8
by: nimish | last post by:
I have Month, Day and Year fields on my form. When I submit this form I want to create a valid date from all three fields before inserting into MYSQL table. I tried following:...
4
by: Sandy Fleming | last post by:
What is the easiest way to force Access to read a date in a specific format? I have an application that imports a delimited text file with a date field in the format "mm/dd/yyyy". I've...
1
by: Paul | last post by:
Is there a way in Access to convert a date in format "mdy - 08/05/2005" to "ymd - 2005-08-05" using an update query?
1
by: Franck | last post by:
Hi, 'm gettin mad about date conversion. Here is the point. Got and add-in for Excel which call functions from a web service (on a remote server) The remote server has regional settings set...
3
by: amerar | last post by:
Hi All, I want to convert a date...... I am given the Day of the Week, plus the Hour and Minute. I want to convert that into a YYYY-MM-DD HH:MI format so I can store it and sort it in...
1
by: jimmy | last post by:
I'm trying to insert a date into a MySQL date column. The string i am trying to insert takes the following format: 2007-02-23 which corresponds to the date format that MySQL uses which is...
2
by: tariquetuku | last post by:
Can anyone plz advice, how to change mysql date format to (d-m-Y) permanently which will affect all the databases in the mysql server. i.e, i want to change the date format in one place which will...
2
by: RN1 | last post by:
A TextBox displays the current date (in dd/mm/yyyy format) & time when a user comes to a page (e.g. 15/10/2008 1:36:39 PM). To convert the date into international format so that the remote server...
4
maheshwag
by: maheshwag | last post by:
my code is: string sql="insert into dummy(date)values(@date) sqlcommand cmd=new sqlcommand(sql,con) cmd.parameters.Add("@date", SqlDbtype.datetime).values=maskedtextbox1.text;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.