Questions tagged [datetime-conversion]

Use this tag for questions related to the Datetime conversion, i.e. manipulating the Datetime in such a way, that a new, different in format, Datetime is produced.

is used in its general meaning, and is usually used for questions related on how to convert a Datetime object in another, new and with a different format, Datetime object, usually for making two different programming platforms communicate.

For example, your application may produce Datetimes of a specific format, but your Database to accept another Datetime format, different from the one your application is using. In that case, a conversion form the application's format to the Database's format is needed.

316 questions
0
votes
2 answers

String was not recognized as a valid DateTime when converting to DateTime

I'm trying to convert a string to DateTime and then insert it to sql. In my local computer all works fine, but on the server the application throws an exception: String was not recognized as a valid DateTime I use Textboxs to create a datetime…
Dvirski
  • 321
  • 4
  • 16
  • 36
0
votes
5 answers

time conversion in java

I have a code that looks like this: Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2013-06-03 00:00:00"); System.out.println(date); DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Calendar…
tkyass
  • 2,968
  • 8
  • 38
  • 57
0
votes
2 answers

Error while parsing string of time to calendar

Im using the following code to convert from string with value 09:10:06 but in the cal set time I got exception: Unparseable date: "09:19:06" how can I overcome this issue. DateFormat df = new SimpleDateFormat("dd.MM.yyyy"); Calendar cal =…
James Berners
  • 103
  • 2
  • 11
0
votes
1 answer

1357133639816 milliseconds conversion in PHP 5.3

I have looked every where for a solution to convert 1357133639816 milliseconds into dd-mm-yyyy h:m:s using PHP 5.3 and also convert current server time into the same millisecond format as given above. This value is an extract from an SMS on android…
Viktor Tango
  • 453
  • 9
  • 19
-1
votes
1 answer

Time Conversion in java from SGT to UTC not working for 12:35:42

Trying to convert Singapore Time to UTc and need the result in OffsetDateTime. The below code works for me for all scenerios except one for 12:35..... for 12:00 noon it is somehow giving wrong results. Should be giving 8th Feb 04:35 morning but…
-1
votes
1 answer

how to find if time is between two given times using moment js

i 3 given times, i want to check if myTime is in between start time and end time. import moment from "moment"; const startTime= moment("18:45", "hh:mm").format("hh:mm a"); const endTime = moment("09:30", "hh:mm").format("hh:mm a"); const myTime=…
Shahmir
  • 31
  • 6
-1
votes
1 answer

Convert any time zone to another (Java)

String time ="6:30" How can I convert it to CST time zone? If a user enters any time, it should convert into CST.
Akshay Kala
  • 159
  • 1
  • 1
  • 4
-1
votes
2 answers

Date Conversion to UTC in Excel

I have the below dates received in an Excel cell. I want them to be subtracted from 8 hours from the given date 2022-03-16T23:02:14+08:00 2022-03-17T07:59:46+08:00 2022-03-17T08:00:34+08:00 Here, I need output as for…
-1
votes
3 answers

Need to insert date column along with time and mins

I need to insert the date column record along with hour,min,sec, for example my joining date is 10/10/2021 but i need to insert 10/10/2021 08:05:25 i need output like this to get inserted My insert query: INSERT INTO…
Abinnaya
  • 203
  • 4
  • 26
-1
votes
1 answer

Time format issue with go language

I am using go 14.4 version and seeing a particular issue when converting time. So I need current time to be converted to this format 2006-01-02T15:04:05Z and using below code currentTime := time.Now().Format(time.RFC3339) currentDateTime, _ :=…
supriya
  • 37
  • 1
  • 5
-1
votes
2 answers

PHP; time conversion form distance and speed

I have problem in converting time which I got from speed and distance, here's my code; $dist = 30; // Distance which is in kilometres(km) // speed is in knots(kt), if I take speed of 40kt and convert it into kilometres(km/h) ... 40 * 1.852 =…
nway
  • 29
  • 1
  • 6
-1
votes
2 answers

Converting 2 strings with milliseconds into date and calculating time difference java

I have 2 strings with minutes, seconds and miliseconds String startTime = "02:58.917" String finishTime = "04:03.332" and I need to calculate time difference. As i understand (but I'm not sure) the most simple way is to convert them into Date type,…
Ilya
  • 135
  • 1
  • 2
  • 10
-1
votes
1 answer

How can I round seconds to 2 places upon using R package lubridate's seconds_to_period function?

I converted seconds to DD:HH:MM:SS format using the R package Lubridate's function seconds_to_period. Now I have a huge list of times which look like this -> 2d 7H 1M 5.31500000000233S. I need to round off the seconds to 2 decimal places. I tried…
Harshit Nagar
  • 368
  • 3
  • 16
-1
votes
1 answer

how to print numeric value to DateTime format in java

Easy in PHP but how will it be in Java. $value="1562916792"; echo date("Y-m-d h:i:sa", $values['time']); output: 2019-07-12 01:03:12pm
Saquib Azam
  • 73
  • 1
  • 4
-1
votes
1 answer

Converting Feb 21, 2019 6:10 AM to mm/dd/yyyy in R

I am trying to convert my date from Feb 21, 2019 6:10 AM to mm/dd/yyyy format and have used lubridate::mdy_hms() like this: d1=mdy_hms(data$`First Activity (America/New_York)`) data$`First Activity (America/New_York)` <- date(d1) Now this converts…