If we need to use the current time as a string as the name of a picture, we need to convert the current time NSDate type data into the NSString type.or in the network request, our time on the network is a string but locally we need to output the nsdate type of data.So providing two methods the first is to convert data of type nsdate to nsstring type data, the second is to convert nsstring type data into NSDate type data1.NSDate-NSString// Get current Time NSDate *date = [NSDate date]; // Set Dat
()CURRENT_TIMESTAMPReturns the current date and time in 'yyyy-MM-DD HH: MM: SS' or YYYYMMDDHHMMSS format, depending on whether the function is in a string or in a numberThe context is used.Mysql> select NOW ();-> '2017-12-15 23:50:26'Mysql> select NOW () + 0;-> 19971215235026
UNIX_TIMESTAMP ()UNIX_TIMESTAMP (date)If no parameter is called, a Unix timestamp (in seconds starting from '2017-01-01 00:00:00 'GMT) is returned ). If UNIX_TIMESTAMP () usesTh
modifiers generate a NULL value or 0.CURDATE ()Returns today's date value in 'yyyy-MM-DD 'or YYYYMMDD format, depending on whether the function is used in a string or numeric context.Mysql> select CURDATE ();-> '2017-12-15'Mysql> select CURDATE () + 0;-> 19971215
CURTIME ()Returns the current time value in 'hh: MM: SS' or HHMMSS format, depending on whether the function is used in a string or in the context of a number.Mysql> select CURTIME ();-> '23: 50: 26'Mysql> select CURTIME () + 0;-> 2350
on whether the function is used in a string or in the context of a number.Mysql> select curtime ();-> '23: 50: 26'Mysql> select curtime () + 0;-> 235026
Now ()Sysdate ()Current_timestampReturns the current date and time in 'yyyy-MM-DD hh: mm: ss' or yyyymmddhhmmss format, depending on whether the function is in a string or in a numberThe context is used.Mysql> select now ();-> '2017-12-15 23:50:26'Mysql> select now () + 0;-> 19971215235026
Unix_t
whether the function is used in a string or a numeric context.
Mysql> select Curdate ();
' 1997-12-15 '
Mysql> Select curdate () + 0;
19971215
Curtime ()
Current_time
Returns the current time value in ' HH:MM:SS ' or HHMMSS format, depending on whether the function is used in a string or in the context of a number.
Mysql> select Curtime ();
' 23:50:26 '
Mysql> Select Curtime () + 0;
235026
Now ()
Sysdate ()
Current_timestamp
Returns the current date and time in ' Yyyy-mm-dd HH:MM:SS
Interpreting mysql time functions sysdate () And now () NOW () www.2cto.com return the current date and time value in the format of 'yyyy-MM-DD HH: MM: ss' or YYYYMMDDHHMMSS, the specific format depends on whether the function is used in a string or a digital context. Mysql> select now ();-> '2017-12-15 23:50:26 'mysql> select now () + 0;-> 1997 in a bucket or trigger, NOW () returns a constant time, which indicates the time when the program or trigge
()CURRENT_TIMEReturns the current time value in 'hh: MM: ss' or HHMMSS format, depending on whether the function is used in a string or in the context of a number.Mysql> select CURTIME ();-> '23: 50: 26'Mysql> select CURTIME () + 0;-> 235026
NOW ()SYSDATE ()CURRENT_TIMESTAMPReturns the current date and time in 'yyyy-MM-DD HH: MM: ss' or YYYYMMDDHHMMSS format, depending on whether the function is in a string or in a numberThe context is used.Mysql> se
Time and date ing types of hibernate (it seems that Java. Until. date is quite common)
Hibernate Data Type
Java Data Type
Standard SQL type
Description
Date
Java. Until. Date/Java. SQL. Date
Date
YYYY-MM-DD
Time
Java. Until. Date/Java. SQL. Time
Time
Hh: mm: SS
Timestamp
Java. Until. Date/Java. SQL. Timestamp
Timestamp
Yyyymmddhhmmss
Calendar
context.Mysql> select CURDATE ();-> '2017-12-15'Mysql> select CURDATE () + 0;-> 19971215
CURTIME () 22. CURRENT_TIMEReturns the current time value in 'hh: MM: ss' or HHMMSS format, depending on whether the function is used in a string or in the context of a number.Mysql> select CURTIME ();-> '23: 50: 26'Mysql> select CURTIME () + 0;-> 235026
23. NOW () SYSDATE () CURRENT_TIMESTAMPReturns the current date and time in 'yyyy-MM-DD HH: MM: ss' or YYYYMMDDHHM
; select curdate () + 0;-> 19971215
Curtime () Current_timeReturns the current time value in 'hh: mm: ss' or hhmmss format, depending on whether the function is used in a string or in the context of a number.Mysql> select curtime ();-> '23: 50: 26'Mysql> select curtime () + 0;-> 235026
Now () Sysdate () Current_timestampReturns the current date and time in 'yyyy-MM-DD hh: mm: ss' or yyyymmddhhmmss format, depending on whether the function is in a s
string STR = string. empty; streamreader sr = new streamreader (path, Code); // converts a file to a stream STR = Sr. readtoend (); // read the stream from the beginning to the end of Sr. close (); // close the read stream string filename = datetime. now. tostring ("yyyymmddhhmmss") + ". html "; // create a file name STR = Str. replace ("$ title $", textbox1.text); // Replace title // STR = Str. replace ("$ content $", textbox2.text); // replace cont
! = NULL)69 .{70. Conn. Close ();71 .}72.} catch (sqlexception ex)73 .{74. ex. printstacktrace ();75 .}76 .}77 .}78.79. // obtain the current time string, which is returned in yyyymmddhhmmss format, such as 2005050501010180. Private Static string getcurrdatetimestr ()81 .{82. simpledate form at SDF = new simpledate form at ("yyyymmddhhmmss ");83. Return SDF. Form at (new date ());84 .}85 .}
The valueb
()Current_dateReturns today's date value in 'yyyy-MM-DD 'or yyyymmdd format, depending on whether the function is used in a string or numeric context.Mysql> select curdate ();-> '2017-12-15'Mysql> select curdate () + 0;-> 19971215
Curtime ()Current_timeReturns the current time value in 'hh: mm: ss' or hhmmss format, depending on whether the function is used in a string or in the context of a number.Mysql> select curtime ();-> '23: 50: 26'Mysql> select curtime () + 0;-> 235026
Now ()Sysdate ()Cu
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.