[Solved] Java / Scala – how to convert string to long?


java.sql.Timestamp (a subclass of java.util.Date) uses milliseconds for time while the Unix timestamp counts seconds. If you have a Unix timestamp you need to multiply it by 1000 (and divide by 1000 to get a Unix timestamp from a Java Date).

solved Java / Scala – how to convert string to long?