Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Proper date format

Posted on 2007-03-24
3
Medium Priority
?
816 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 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

618 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