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
-2
votes
2 answers

java.time.format.DateTimeParseException: Text '09/10/2019' could not be parsed at index 0 could not be parsed, unparsed text found at index 19

I am developing news app and I have converted elapsed time from now to that date but when I run code I am getting following exception in my adapter class java.time.format.DateTimeParseException: Text '09/10/2019' could not be parsed at index 0 could…
Edgar
  • 860
  • 1
  • 17
  • 38
-2
votes
2 answers

How to add one hour to UTC in android

I'm trying get current time and then, convert to UTC+1 time zone which is in yyyy-MM-dd HH:mm:ss format I tried the following code. It didn't work. Can anyone help? public static String getDateTime() { Date time =…
Jin
  • 21
  • 5
-2
votes
1 answer

How to use moment js to convert "hh:mm:ss" time format into hours, minutes, seconds?

For example, I have a time string in the form "00:30:00", so the output should be 30 minutes. Or if we have "15:00:30", so the output should be 15 hours 30 seconds. Can it be done using moment? or do I need to write my own code?
onezero
  • 109
  • 1
  • 10
-2
votes
1 answer

DateTimeFormat issue

I have a string like below 1/1/1970 12:00:00 AM I want it in the yyyy-MM-dd format (in this case 1970-01-01) My parsing code is var actualDate = DateTime.ParseExact(actualValue,"MM/dd/yyyy HH:mm:ss…
user5534263
  • 138
  • 12
-2
votes
1 answer

DateTime Time Zone conversion bug

I try to convert my local time (Kiyv, Riga, UTC+02:00) to UTC, but there is an error in the following method TimeZoneInfo.ConvertTimeToUtc(clientDate, TimeZoneInfo.FindSystemTimeZoneById(tTimeZone.SystemId)); clientDate is 19.06.2015…
-3
votes
1 answer

How to convert a string such as '00H 00m 00s' to seconds (int type) on Python3?

Say you have the following string values: str_one = '03H 49m 06s' str_two = '18m 23s' str_three = '56s' How could these strings be converted to int such that the output is as follows (correspondingly)? 13746 1103 56 Update, I found my own…
NoahVerner
  • 937
  • 2
  • 9
  • 24
-3
votes
1 answer

How to convert time of a specific zone to local system time zone in C#?

I have got a time format from a file in this format "03:45:00 AM CST" from a column record. Additionally I have to convert this into utc and then to est time zone or local system's time. I have tried this approach so far but all in vein. Any help…
Shreya Rawal
  • 182
  • 3
  • 14
-3
votes
2 answers

What is wrong in sql

What is wrong in sql CONCAT(title, ', from ', CONVERT(DATETIME,CONVERT(NVARCHAR,startdate,107)), ' to ', CONVERT(DATETIME,CONVERT(NVARCHAR,end_date,107)), ' (', duration , ')') I want to change datetime to Sep 25, 2018 format
-3
votes
3 answers

How to convert a long to a Date with "dd/MM/yyyy" format

I have a variable of type Long. Long longDate = 20180201110400 It represents this: 2018/02/01 11:04:00 I want to convert the format and variable type like below: Format should be "dd/MM/yyyy" and type should be Date. How can I do that?
fuat
  • 1,484
  • 2
  • 19
  • 25
-3
votes
2 answers

convert this time format into seconds, SELECT ROUND(TIME_TO_SEC('8: 2:9')/60);

Convert this time format into seconds: SELECT ROUND(TIME_TO_SEC('8: 2:9')/60); I want the output is 482 minutes in MySQL. some times in a data base time stored with space for example '08:02:23' is saved as '08: 2:23' so want to retrieve that time…
-3
votes
1 answer

Counting down seconds from 1970 time in javascript

I am using an API that returns the time like this deal_expiration_time:1469396377 which looks like its seconds from 1970. I am trying to get a countdown in MM/SS This is in angular so I apparently can't use jQuery? I have struggled for a while and…
-6
votes
1 answer

Cannot resolve method 'withZone' in 'OffsetDateTime'

I have the following code that I want to migrate to Java 17: Gradle dependency: implementation 'org.jadira.usertype:usertype.core:7.0.0.CR1' Entity: import org.joda.time.DateTime; @Entity @Table(name = "logs") public class Log { …
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
-6
votes
2 answers

Java Date and utcTimeOffset

I have a Java Date (java.util.Date) - Tue Jul 31 00:53:43 CEST 2018 and a utcTimeOffset = +0200, which says that give, date is +2 hours from UTC. This is a legacy code and Java 8 is not an option. What I am getting is text representation of date as…
SJay
  • 15
  • 4
-6
votes
1 answer

Convert a time string "20180425.142117" to human readable format?

I want this string "20180425.142117" to convert to human readable format. E.g. 25th April 2018, 2:21 pm in Python Any ideas how to do this?
AS_ON
  • 173
  • 2
  • 7
-6
votes
1 answer

convert time to Unix Time stamp

I need to convert the following date in to Unix format using php code. 2014-06-10T11:05:10.723Z to Unix?
user3820288
  • 225
  • 1
  • 5
  • 13
1 2 3
21
22