Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1031830 // timestampFromYMDHM

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (41L/1K).

// month = 1 to 12
static long timestampFromYMDHM(int y, int m, int d, int h, int minutes) {
  ret new GregorianCalendar(y, m-1, d, h, minutes).getTimeInMillis();
}

static long timestampFromYMDHM(int y, int m, int d, int h, int minutes, TimeZone tz) {
  ret new Calendar.Builder()
    .setTimeZone(tz)
    .setDate(y, m-1, d).setTimeOfDay(h, minutes, 0)
    .build().getTimeInMillis();
}

Author comment

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: 229 / 338
Version history: 2 change(s)
Referenced in: [show references]