1. The Date_format () function is used to display date/time data in different formats.
The format parameter is formatted with
%a
Abbreviated Week name
%b
Abbreviated month name
%c
month,
Recently made a JavaScript to display the next day's date case now the function code is published
Date.prototype.pattern=function (FMT) {var o = {"m+": This.getmonth () +1,//month "d+": th Is.getdate (),//day "h+": this.gethours ()%12 = = 0?
Use this method
Long time = Date.parse ("Sun Feb 10:31:58 +0800)";
SimpleDateFormat sdf=new SimpleDateFormat ("Yyyy-mm-dd");
Date d = new date (time);
System.out.println (Sdf.format (d));
Time format in the United States
G
Processing of date and time data.(1) String date' 20080301 ', which is a string date, but must be guaranteed as a four-bit year, two-bit month, and two-bit date. For example, the Query order table date is greater than ' 20080301 '. It can be written
javascript Default time format We don't normally use it, so we need to format it, and here's what I've summed up about the JavaScript time formatting method Many times, we can use the built-in methods of the Date object in JavaScript to format it,
'******************************
' Function: FormatDate (DATEANDTIME, para)
' Parameters: DateAndTime, date time to format; para, style.
' Author: Arisisi
' Date: 2007/7/12
' Description: Format the date as needed
' Example:
'************************
It's annoying to talk about the output of a date string.
Under Linux, a simple word: Date ' +%y%m%d-%h%m%s ' can get the output you want: 20120331-064219But under Windows, it will take a bit of effort to get this.
1. Format output directly with
This example describes the method for formatting dates in PHP. Share to everyone for your reference.
The specific implementation code is as follows:
Copy Code code as follows:
function Showdate ($flag =0, $timestr =null)
{
Get a week
$
Example one:
TT
Example two:
Example three:
Date.prototype.Format = function (formatstr) {var str = FORMATSTR;
var Week = [' Day ', ' one ', ' two ', ' three ', ' four ', ' five ', ' six ']; str =
Convert iso8601 format to datetime object
This is mainly used for the static method of DateTime ParseExact (string s, string format, System.iformatprovider provider)
Copy Code code as follows:
$dateTimeStr = ' 20141231t23:59:59 '
century Digit (yy) with century digit (yyyy)StandardInput/Output * *-0 or 100 (*) default value mon dd yyyy hh:miam (or PM)1 101 American Mm/dd/yyyy2 102 ANSI Yy.mm.dd3 103 British/French DD/MM/YY4 104 German Dd.mm.yy5 105 Italian Dd-mm-yy6 106-dd
[Preface]
Recently, the project requires a special date format, which exactly belongs to the string type. In the past, simpledateformat was not used to format the date. The idea in my mind is to first give the date to tostring, then cut the
First, DateFormatUse Getdateinstance to get the standard date format for that country/region. Additional static factory methods are also available. Use Gettimeinstance to get the time format for that country/region. Use Getdatetimeinstance to get
Blog
Community
Homepage
New essay
Contact
Management
Subscription
Post-42-0 comments-72 differences between java. util. Date and java. SQL. Date and the application of java. util. Date are used in addition to SQL statements.
Java. SQL. Date is
Shell script to get the formatting Date and Time Summary
The Shell script obtains the formatting Date and Time summary. The Linux bash script's support for time formats exceeds my expectation and supports changes and outputs in multiple formats. It
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.