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

8
LINES

< > BotCompany Repo | #1026050 // localTimeWithOptionalDate_24

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

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

import java.text.*;

sS localTimeWithOptionalDate_24(long time) {
  SimpleDateFormat format = simpleDateFormat_local("yyyy/MM/dd");
  S date = format.format(time);
  bool needDate = neq(date, format.format(now()));
  ret (needDate ? date + " " : "") + localTime_24(time);
}

Author comment

Began life as a copy of #1009026

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1026050
Snippet name: localTimeWithOptionalDate_24
Eternal ID of this version: #1026050/1
Text MD5: 3b43182d741110d14d1bb3bfda5cdb6b
Transpilation MD5: bd44f2bd367d29d45c8dd32037eee4c6
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-16 14:43:09
Source code size: 280 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 240 / 359
Referenced in: [show references]