Solved

Proper date format

Posted on 2007-03-24
3
772 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 142

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now