Libraryless. Click here for Pure Java version (41L/1K).
1 | // month = 1 to 12 |
2 | static long timestampFromYMDHM(int y, int m, int d, int h, int minutes) {
|
3 | ret new GregorianCalendar(y, m-1, d, h, minutes).getTimeInMillis(); |
4 | } |
5 | |
6 | static long timestampFromYMDHM(int y, int m, int d, int h, int minutes, TimeZone tz) {
|
7 | ret new Calendar.Builder() |
8 | .setTimeZone(tz) |
9 | .setDate(y, m-1, d).setTimeOfDay(h, minutes, 0) |
10 | .build().getTimeInMillis(); |
11 | } |
Began life as a copy of #1011261
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
| Snippet ID: | #1031830 |
| Snippet name: | timestampFromYMDHM |
| Eternal ID of this version: | #1031830/3 |
| Text MD5: | fed3b6a1c5b308459cd01d8cdeffca76 |
| Transpilation MD5: | d5c8385ccae05bd872aeaf88dd7b12d2 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2025-04-20 18:07:22 |
| Source code size: | 398 bytes / 11 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 2797 / 3182 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |