window.ENTITIES={'/api/snippets/java/java%20-%20get%20utc%20timestamp%20(in%20milliseconds)':[{"result":true,"message":null,"batch":{"type":"java","name":"java - get utc timestamp (in milliseconds)","items":[{"id":"jvy4ap","type":"java","name":"Java - get UTC timestamp (in milliseconds)","content":"// import java.time.Instant;\n\nvar instant = Instant.now();\nvar timestamp = instant.toEpochMilli(); // in milliseconds\n\nSystem.out.println(timestamp); // e.g. 1716906171362","source":"","author":{"id":"EagrJD","name":"Emrys-Li","avatar":"1629030400454__EagrJD__w40px_h40px.png","points":580,"role":"BASIC"},"creationTime":1716906574000,"updateTime":null,"removalTime":null},{"id":"1w6Zvj","type":"java","name":"Java - get UTC timestamp (in milliseconds)","content":"var timestamp = System.currentTimeMillis(); // in milliseconds\n\nSystem.out.println(timestamp); // e.g. 1716906171362\n\n\n// Note: The method returns the current time in milliseconds. Note that while the unit of time of the return value \n// is a millisecond, the granularity of the value depends on the underlying operating system and may be larger.\n// For example, many operating systems measure time in units of tens of milliseconds.\n\n\n// References:\n//\n// 1. https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#currentTimeMillis--","source":"","author":{"id":"eaBRAa","name":"RomanaLittle","avatar":"1629131067673__eaBRAa__w40px_h40px.jpg","points":458,"role":"BASIC"},"creationTime":1716924642000,"updateTime":1716924756000,"removalTime":null}]}}]};