Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Morons/CryptoCodeAndroidLibrary.old

Repository files navigation

by CryptoCode

an Library for Android Users

Initial Commit only include kotlinx.datetime utils, others will follow.

Sample time related functions

NOTEs:

  1. use .toEpochMilliseconds() to convert to Long values
  2. ALWAYS store dates un UCT
  3. for this demo I used pastXDaysUtc(days = 5).toEpochMilliseconds().relativeTimeSpanUtc() to get a Long TimeDate value
  4. for this demo I used now() (kotlinx.datetime.Clock.System.now) for Instant
  • Instant.dateTimePeriod()=PT0.000324000S
  • nowToLongSystemDefault()=1700058378780
  • currentMoment()=2023-11-15T14:26:18.780031Z
  • getCurrentTimeInSeconds()=1700058378
  • currentDayFormatted()=2023 NOVEMBER 15
  • currentMomentUtc()=2023-11-15T14:26:18.780062Z
  • nowToLongUtc()=1700058378780
  • nextMonthUtc()=2023-12-01T00:00:00Z
  • firstDayUtc()=2023-11-01T00:00:00Z
  • lastDayUtc()=2023-11-30T00:00:00Z
  • dateInUtc()=2023-11-15
  • in30DaysUtc()=2023-12-15T14:26:18.780031Z
  • inXDaysUtc(days = 20)=2023-12-05T14:26:18.780031Z
  • past15DaysUtc()=2023-10-31T14:26:18.780031Z
  • past60DaysUtc()=2023-09-16T14:26:18.780031Z
  • pastXDaysUtc(days = 20)=2023-10-26T14:26:18.780031Z
  • Long.relativeTimeSpanUtc()= 5 days ago

P.S. Request more Utilities if you need.

About

an Library for Android Users

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages