Tag:current time

  • Ajax gets the current time dynamically (PHP)


    Client code: Copy codeThe code is as follows: <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ /> < title > dynamic display time < / Title ></head> <script language=”javascript”> var xmlHttp; function createXMLHttpRequest(){ if(window.ActiveXObject){ xmlHttp = new ActiveXObject(“microsoft.XMLHTTP”); } else if(window.XMLHttpRequest){ xmlHttp = new XMLHttpRequest(); } else{ Alert […]

  • IOS gets the exchange instance of current time and timestamp


    In the project development, it is inevitable to encounter the use of current time, such as network request upload message, appointment, calendar and other functions. 1. Get year, month, day, hour, minute, second Implementation code: NSDate *date1 = [NSDate date]; NSDateFormatter *formatter1 = [[NSDateFormatter alloc] init]; [formatter1 setDateStyle:NSDateFormatterMediumStyle]; [formatter1 setTimeStyle:NSDateFormatterShortStyle]; [formatter1 setDateFormat:@”YYYY-MM-dd hh:mm:ss”]; NSString *DateTime1 […]

  • Solution to the problem of eight hours difference in MySQL insertion time


    Solve the problem of eight hours difference in MySQL insertion time Generally, several parameters need to be added to the JDBC URL, and most of the tutorials given by blogs areuseSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTCThese parameters, The configuration results are as follows:jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC To solve the time zone problem, I used to use servertimezone = UTC. Until today I stepped […]

  • How to generate files named at current time under windows and Linux


    Windows bat batch file: Copy codeThe code is as follows: @echo off set time_hh=%time:~0,2% if /i %time_hh% LSS 10 (set time_hh=0%time:~1,1%) set filename=%date:~,4%%date:~5,2%%date:~8,2%_%time_hh%%time:~3,2%%time:~6,2% echo test >> %filename%.txt Linux shell script: Copy codeThe code is as follows: #!/bin/sh echo test >> $(date -d “today” +”%Y%m%d_%H%M%S”).txt

  • How to get the current date and time from PostgreSQL and precautions


    When developing database applications or debugging code, you often need to get the current date and time of the system. Let’s take a look at the related functions provided in PostgreSQL. current date CURRENT_DATE The current date function gets the current date of the database server: postgres=# SELECT CURRENT_DATE; current_date ————– 2019-09-28 (1 row) The […]