indicates the day of the year; dy indicates the day of the week, such as Friday or fri;
Day indicates the day of the week; hh 2-digit indicates 12-digit hour; hh24 2-digit indicates 24-hour;
2-digit mi indicates minute;
Two-digit ss indicates 60 seconds;
Time range in the 24-hour system: 00: 00: 00-23:59:59
Time range in the 12-hour format: 1: 00: 00-12:59:59;
2. Function to_char (sysdate, 'yyyy-mm-dd hh24: mi: ss ')
To_date ('1970-10-29,13: 25: 59'
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 ){Var formate_datetime;Var array = d. split ("
Enter in DOS mode first:
1.CD C:Program filesmysqlmysql Server 5.5bin
2.mysql-h127.0.0.1 (the address of the host you want to access)-uroot (username)-proot (password)
3.show variables like ' character% ';
You can view the MySQL encoding format
This completes the view of the encoded format in your MySQL, and if you want to modify it, continue with the following steps:
Open MySQL installation di
In the development process, we often store the milliseconds of datetime to the database, but its corresponding time seems very inconvenient, we can use some functions to convert milliseconds to date format.
First, in MySQL, there is a built-in function from_unixtime () to do the corresponding conversion, using the following:
Copy Code code as follows:
Mysql> Select From_unixtime (1, '%y-%m-
The database is clearly the time to return but become a string of irregular numbers. Solving method
/*** Time stamp Turn time format* Number of times of @param jsondate*/
function Getlocaltime (jsondate) {Jsondate= "" +jsondate+ "";//Because Jsondate is a number type, indexof will complain.if (Jsondate.indexof ("+") > 0) {Jsondate = jsondate.substring (0, Jsondate.indexof ("+"));}else if (Jsondate.indexof (
Data | database | Conversion As long as the name of the date format specified in convert is enough, such as:
Select CONVERT (char (), GETDATE (), 101)
Select Emp_id,convert (char (), hire_dt,101) from employee
-----------------------------------------------------
Date format Code
-------------------- -----------
04/05/2000 101
-------------------- ----------
Jsonutil {/** * convert resultset collection to jsonarray array * * @param RS * @return * @throws Exception*/Public static Jsonarray Formatrstojsonarray (ResultSet rs) throws Exception {ResultSetMetaData MD= Rs.getmetadata ();//Get Table Structure intnum = Md.getcolumncount ();//get the total number of rowsJsonarray array =NewJsonarray ();//JSON array, looking for value according to subscript; [{name1:wp},{name2:{name3: ' ww '}}]name is the key value, WP is the value //Jsonarray A
About this I know can use Str_replace to replace \ ", but this will also have a problem, if the JSON format of the data inside the Chinese characters, the \ASD5 will become ASD5. Is there any other way to solve this problem?
Reply to discussion (solution)
Why/Will it turn into a/, do you find the reason?/Not a special character, no PHP function escapes it (except Preg_quote)
You can use the str_replace to replace \/with '/' ....
Why/Will it
This format control and editing coordination FCKeditor is used, is perfect, fckeditor use in my other posts have a simple introduction.
When you read data from a textarea, and then read the data from the database, the simplest way to control how it appears in the JSP page as entered in textarea is to use
Adding such a statement to a CSS file can fix this problem.
pre{White-space:pre-wrap;White-space:-mo
$db =new mysqli ("localhost", "root", "123", "t_90052");$sql = "SELECT * from Info";$result = $db->query ($sql);$arr = $result->fetch_all ();foreach ($arr as $v){$sex = $v [2]? " Male ":" Female ";Eaho "}?>Displaying information about database info tables in tabular format
Summary
The IP database on the network is the most popular with the pure version, LUMAQQ also uses the pure version IP database as the basis of the IP query function. However, the document on its format is very small, and then finally found a document on the Internet to understand its insider, but the document is very few words, but also quite patient to read. H
The following describes how to configure csv log output in postgresql database (a more detailed log output method in postgresql. 1. Go to the $ PGDATA directory (postgresql installation directory, which varies according to the actual name) and find the configuration file postgresql. conf2. enable the csvlog output function: # enable cs
The following describes how to configure csv log output in postgresql database
Created a project on GitHub: Https://github.com/ThinkerCodeChina/jsonDB/** +-----------------------------------------* JSONDB data Model built based on JSON data format +---------------------------------------- -* @description to JSON data retrieval, deletion, query and update * @author Bang (web programmer) [email protected] * @date June 28, 2014 * @version0.1 * @blog HTTP://BL og.csdn.net/thinkercode/+-----------------------------------------* Simpl
When you create a database using SQL statements in MySQL, you always forget to specify the encoding format. This results in the problem of Chinese garbled in the process of accessing the database using the UTF-8 format project. It was later discovered that most of the problems were not specified in the encoding
Tags: SAR date format BSP his database ret daily proc RingAfter Response.getwriter (). Write (JSON) to the foreground date format confusing problem summary Import Java.text.SimpleDateFormat;Import Net.sf.json.JsonConfig;Import Net.sf.json.processors.JsonValueProcessor; public class Datejsonvalueprocessor implements Jsonvalueprocessor{Private String
Many people may have their own ASP personal homepage, but there is not a lot of database permissions, today I give a method. You can build them yourself.
Stand a library. Not in Access or SQL Server format. is to build a format of your own. (It sounds high and deep!) Previously developed a data
Library, they're all very powerful system analysts. Let's make some m
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.