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

15
LINES

< > BotCompany Repo | #1004679 // ymd

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

Libraryless. Click here for Pure Java version (10821L/59K).

sS ymd() {
  ret ymd(now());
}

sS ymd(long now) {
  ret year(now) + formatInt(month(now), 2) + formatInt(dayOfMonth(now), 2);
}

sS ymd(long now, TimeZone tz) {
  ret year(now, tz) + formatInt(month(now, tz), 2) + formatInt(dayOfMonth(now, tz), 2);
}

sS ymd(Date date) {
  ret date == null ?: ymd(date.getTime());
}

download  show line numbers  debug dex  old transpilations   

Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, elmgxqgtpvxh, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1004679
Snippet name: ymd
Eternal ID of this version: #1004679/5
Text MD5: 24e07b7c35823fb8437102e78d7cfd2f
Transpilation MD5: e9d7a7f21a49292d4d621eb887424c40
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2025-05-12 23:22:50
Source code size: 335 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 744 / 779
Version history: 4 change(s)
Referenced in: [show references]