Solved

Proper date format

Posted on 2007-03-24
3
796 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 250 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

821 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