During page initialization, JavaScript is used to format the date type read from the database to the desired type. Format it as yyyy MM mm dd hh mm mm ss seconds. You can refer to the following code for free use.
The Code is as follows:
// Input the date data retrieved from the databaseFunction getformatdate (d )
Copy Code code as follows:
Passing in the date type data fetched from the database
function Getformatdate (d) {
var formate_datetime;
var array = d.split ("");
var date = array[0];
var time = array[1];
var array_date = Date.split ("-");
var array_time = Time.split (":");
var second = Array_time[2].split (".") [0];
Formate_datetime = array_date[0] +
Mysql database learning (2): data type (numerical date and time string type)
Mysql database learning (2): data type (value type date and time type character _ MySQL
Data
output is: Mon Dec 00:00:00 CST 2005System.out.println (Df.format (DT)); The output is: 2005-2-194. Convert the string to Java.sql.DateThe string must be in the "YYYY-MM-DD" format, or the illegalargumentexception exception will be thrownJava.sql.Date sdt=java.sql.date.valueof ("2005-9-6");System.out.println (SDT); The output is: 2005-9-65. Formatted output date time (this is used more)Date
Tags: format int orm lan blank database C # time dataIt should be noted that there are datetime types in C #, but this type includes hours, minutes, and seconds. This format does not match the date type in the database, and inserting data if now is set to a datetime type will fail. Need to be converted via to_date (' f
Calendar, in milliseconds.void SetTime (date date): Sets the time of this Calendar with the given date.void Settimeinmillis (Long Millis): Sets the current time value for this Calendar with a given long value.**** *************************************New Simpledateformate ("Yyyy-mm-dd hh:mm:ss"). Format (new Date ()); Return String Class objectSummarize:1. Get t
In many pages and Web applications have entered the date and time of the place, the most typical is the booking of air tickets, train tickets, hotels, pizza and other sites.Before HTML5, the most common scenario for such page requirements was to select components with JavaScript dates. This is almost undisputed and has no choice. You can search for a "JavaScript Date selection box" and you'll find countless
In many pages and Web applications have entered the date and time of the place, the most typical is the booking of air tickets, train tickets, hotels, pizza and other sites.Before HTML5, the most common scenario for such page requirements was to select components with JavaScript dates. This is almost undisputed and has no choice. You can search for a "JavaScript Date selection box" and you'll find countless
In many pages and Web applications have entered the date and time of the place, the most typical is the booking of air tickets, train tickets, hotels, pizza and other sites.Before HTML5, the most common scenario for such page requirements was to select components with JavaScript dates. This is almost undisputed and has no choice. You can search for a "JavaScript Date selection box" and you'll find countless
SimpleDateFormat ("YyyyMMdd")). Format (date); PrivateDate AddDays (date date,intN) {Calendar cal=calendar.getinstance (); Cal.settime (date); //Cal.add (calendar.date, n);//N is the increase in the number of days that can be changedCal.add (Calendar.day_of_year, N);//hours plus 1Date =Cal.gettime (); retu
Date classIn JDK1.0, the date class is the only class that represents time, but since the date class is not easy to internationalize, starting with the JDK1.1 version, it is recommended to use the Calendar class for time and date processing. Here is a brief introduction to the use of the
Turn from:http://blog.chinaunix.net/space.php?uid=11327712do=blogid=32416MySQL Date Type: Date format, occupied storage space, date range comparison.Date type storage space date format date
Oracle Data type detailed---date type
Oracle data types look very simple, but there are a lot of knowledge to use, this article is my Oracle date data types of the collation, are the development of introductory materials, to share with you:Note: Because interval and time zone are actually used relatively little, so th
Oracle data type description-date type
Oracle data types seem very simple, but many knowledge points will be found in use. This article is my summary of Oracle date data types, all of which are getting started with development. share with you:Note: Since interval and time zone are rarely used, this article does not co
MySQL date type: Date Format, storage space occupied, and date range comparison.Date type storage space date format date range-----------------------------------------------------------
Oracle date type and processing method explanation, oracle Date Processing MethodDate Processing get current date-sysdate ()
Sysdate () is accurate to seconds.Add a specific month to the date-add_months ()
select add_months(to_date('2010-2-27','YYYY-MM-DD'),1) new_date from
Date type data sent over the front end cannot receive
And then I found a single date matching method.
@DateTimeFormat (pattern= "Yyyy-mm-dd HH:mm:ss")It's okay.
@JsonFormat (pattern= "Yyyy-mm-dd HH:mm:ss", timezone = "gmt+8")
Returns the time of the front-end string format
Reference
When querying the database, the
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.