?
Solved

Proper date format

Posted on 2007-03-24
3
Medium Priority
?
817 Views
Last Modified: 2012-06-27
What is the proper way of writing this?

$date_sent = formatdatetime[date, 2];
0
Comment
Question by:pingeyeg
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 1000 total points
ID: 18785404
what format does the formatedatetime return?

anyhow, check out the php date/time functions page:
http://www.php.net/datetime
you will find this one:
http://www.php.net/manual/en/function.date.php

that should answer your question(s) about date formatting.
0
 
LVL 1

Author Comment

by:pingeyeg
ID: 18785411
Sorry, I forgot to delete this quesiton.  I've already fixed it.  Thanks!
0
 

Expert Comment

by:lorenww
ID: 18785414
What you are trying to do is an asp (VBScript) date stamp which will not work with php.
This is what you want to get the format you are looking for (1st example)

$date_sent = date("n/j/Y"); //will give mdy like this 1/2/2005
also
$date_sent = date("d/m/y"); //will give mdy like this 01/02/05

here is a good url to php.net
http://us2.php.net/manual/en/function.date.php
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month15 days, 11 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question