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

15
LINES

< > BotCompany Repo | #1003425 // year - year of timestamp (4 digits)

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

Libraryless. Click here for Pure Java version (9988L/54K).

1  
static int year() {
2  
  ret localYear();
3  
}
4  
5  
static int year(Timestamp now) {
6  
  ret localYear(toLong(now));
7  
}
8  
9  
static int year(long now) {
10  
  ret localYear(now);
11  
}
12  
13  
static int year(long now, TimeZone tz) {
14  
  ret parseInt(simpleDateFormat("y", tz).format(now));
15  
}

Author comment

Began life as a copy of #1003424

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1003425
Snippet name: year - year of timestamp (4 digits)
Eternal ID of this version: #1003425/7
Text MD5: 618edbacd957071be73678d974e658df
Transpilation MD5: 7782222a104e4874666c86adc72d733b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-01-07 21:28:43
Source code size: 272 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 602 / 705
Version history: 6 change(s)
Referenced in: [show references]