Solved

Proper date format

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

$date_sent = formatdatetime[date, 2];
0
Comment
Question by:pingeyeg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
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.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

728 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