Linked Questions

58 votes
3 answers
112k views

I have a date stored in the DB in string format ddMMyyyy and hh:mm and the TimeZone. I want to create an Instant based on that information, but I don't know how to do it. something like ...
La Carbonell's user avatar
  • 2,086
1 vote
2 answers
21k views

I am trying to get my LocalDateTime field saved as a long so I can store it in my SQLite database. How am I able to do this? var datetime = LocalDateTime.now() var longdt: Long = getString(datetime)....
Clarke Woogner's user avatar
1 vote
2 answers
1k views

Executed piece of code : String lapTime = "27:10.190"; int minutes = Integer.parseInt(lapTime.substring(0, lapTime.indexOf(":"))); int seconds = Integer.parseInt(lapTime.substring(...
Серёга Боров's user avatar
1 vote
0 answers
1k views

I would like to get the date & time now and from that do the following: (i) set the month to the first and (ii) zero out everything after the month (iii) calculate the date 1 year and 1 month ...
Jared's user avatar
  • 125
0 votes
1 answer
503 views

I have an Arduino program that connects to a java web server, and I need to synchronize time. But there is a one hour sync problem. The output of this Java program: public class Test { public ...
David Portabella's user avatar
-2 votes
0 answers
379 views

Java equivalent of JavaScript Date.UTC(1980, 0, 8) Example in JavaScript : var base_date = Date.UTC(1980, 0, 8); console.log("base_date:" + base_date) The result is: base_date:316137600000 ...
ilw's user avatar
  • 2,599
337 votes
9 answers
347k views

I have an external API that returns me dates as longs, represented as milliseconds since the beginning of the Epoch. With the old style Java API, I would simply construct a Date from it with Date ...
Vihung's user avatar
  • 13.5k
63 votes
5 answers
102k views

In the application I am developing, I need to convert java.time.Instant object to java.sql.Timestamp. When I create Instant object like: Instant now = Instant.now(); I receive something like 2017-03-...
Aleydin Karaimin's user avatar
27 votes
3 answers
61k views

I've been trying to convert a "DateTime" to milliseconds using the java.time package built into Java 8. But I haven't been able to do it correctly. I am trying to convert "29/Jan/2015:18:00:00" to ...
Seagull's user avatar
  • 2,339
13 votes
2 answers
14k views

I have read all of the other Q/A about Date Manipulation, but none of them seems to deliver a satisfactory answer to my concern. I have a project with geographically diverse users which uses Date in ...
Joe Almore's user avatar
  • 4,369
4 votes
2 answers
2k views

First off I'm new in this incredible community. This is an amazing site. I'm happy to be part finally. Every day I have to insert yesterday's data in the DB. For example, today May 22, I have to ...
Rusty23's user avatar
  • 71
-2 votes
1 answer
4k views

I am trying to convert a date formatted in yyyy-mm-dd to LocalDate to milliseconds with this code. LocalDate.parse("2022-08-01", DateTimeFormatter.ofPattern("yyyy-MM-dd")) ...
Bitwise DEVS's user avatar
  • 3,851
1 vote
2 answers
2k views

I have a private java.sql.Timestamp myDate in some model (POJO) class like below private String isActive; private Date dob; private Timestamp createdDate; private Timestamp lastMktPrefUpdateAt; We ...
user3250123's user avatar
2 votes
1 answer
2k views

I use Jackson to serialise and deserialise object. I have .NET WCF DateTime JSON format with Time Zone. And Jackson can't deserialise JSON to object. I found some solutions, but is there any Jackson ...
Bilgehan's user avatar
  • 1,227
-1 votes
1 answer
2k views

I can convert 19 digit unix timestamp to LocalDateTime like this Instant instant = Instant.ofEpochSecond( TimeUnit.NANOSECONDS.toSeconds(timestamp), ...
willy's user avatar
  • 355

15 30 50 per page