Answers for "str to date"

PHP
7

php convert string to date

$time = strtotime('10/16/2003');

$newformat = date('Y-m-d',$time);

echo $newformat;
// 2003-10-16
Posted by: Guest on February-28-2020
2

cast string to datetime mysql

SELECT STR_TO_DATE('2017-03-13T14:39:01.123','%Y-%m-%dT%H:%i:%s.%f');
Posted by: Guest on August-07-2020
15

string to date conversion java

import java.text.SimpleDateFormat;  
import java.util.Date;  
public class StringToDateExample1 {  
public static void main(String[] args)throws Exception {  
    String sDate1="31/12/1998";  
    Date date1=new SimpleDateFormat("dd/MM/yyyy").parse(sDate1);  
    System.out.println(sDate1+"\t"+date1);  
}  
}
Posted by: Guest on July-30-2020
2

convert str to datetime

import datetime

# str value "Apr 2, 2019" convert into any format. 
datetime.datetime.strptime('Apr 2, 2019', '%b %d, %Y').strftime('%a, %d %b %Y')
Posted by: Guest on May-13-2020
0

str to datetime time

>>> import datetime
>>> datetime.datetime.strptime('03:55', '%H:%M').time()
datetime.time(3, 55)
Posted by: Guest on June-06-2021

Browse Popular Code Answers by Language