Questions tagged [time4j]

Concerns questions directly related to the alternative date, time and interval library Time4J.

Its API can be either used as enhancement for missing features centered around time and calendars or as replacement of java.time-package on Java-8. There is also a backport available when running on platforms Java-6+7 (using version line v3.x).

The design is mainly orientated towards:

  • thread-safety (immutability)
  • good internationalization (own resources based on CLDR-data)
  • accurate modelling of alternative calendars, historic dates, leap-seconds etc
  • easy conversion and interoperability with java.time-classes
  • extensive interval handling

The source code and issue tracker can be found on GitHub. The API and tutorial are available online under: time4j.net

A sister project named Time4A is very similar but designed for the usage on the Android platform.

25 questions
1
vote
1 answer

How can I get exact UTC current time stamp at time4j without usage of system timezone and system clock?

there! I have to get the accurate current UTC time without calling a system clock or system time zone. I need to get precise UTC time via the Time4j library. The issue that after getting UTC time via different ways there is a mismatch in accuracy…
1
vote
2 answers

How do you import a library in the most recent and up-to-date versions of Android Studio (2017, 2.3.1+)?

I'm wondering about this. I've been trying to import a library ("Time4J" Android version "Time4A") to a project in the Android Studio, and had to try a number of different things before getting it to "work". I finally managed to get it to import…
The_Sympathizer
  • 739
  • 6
  • 14
1
vote
1 answer

Style a regular javafx button and text-field?

I'm using Time-4j-ui library, and somehow it includes a built-in Button and a text box which is Ugly and ruins all my design, In my project I'm using Jfoenix material design components, and this built-in user-interface completely ruins my design,…
Shaheen Zahedi
  • 946
  • 1
  • 10
  • 36
1
vote
1 answer

How to Format Hijri Date

I'm using time4A to do transformation from Islamic Hjiri to Gregorian Date and vice versa. I'm not able to find a way to format Hijri Date to "yyyy/mmm/dd" pattern. Here is the code to convert from Gregorian to Hijri : CalendarVariant variant…
abdou amer
  • 709
  • 1
  • 10
  • 37
1
vote
1 answer

year number convert from gregorian to hijri java time4j

I take a year number from user. How can convert it to hijri year number? Better using not jodatime but time4j or java 8. Example: I need from 2016 to have hijri year number. I have found this post, Is there any library or algorithm for Persian…
Seomat
  • 93
  • 8
1
vote
1 answer

Time4j: Display all days of a year

I use library Time4j for Java and I selected some days as holydays and saved in a variables. Now I want to display all days of a year something like on the picture but with my holydays highlighted. How can I make it?
Seomat
  • 93
  • 8
0
votes
0 answers

Getting error when using jlink to create a runtime image with Time4J CalendarPicker

I am using the Time4J library's Persian calendar picker. When I run the app with ./gradlew run I see it running. But when I launch the JavaFX runtime image of the app, that I build using the Badass JLink Plugin, I get this error: Caused by:…
pooya
  • 3
  • 3
0
votes
1 answer

time4j is not producing monotonic time in long since epoch

I'm trying to produce monotonic time in long since epoch using time4j v5.6 using below test code But output is not expected. Did I miss any initialization of the library? My objective is to produce monotonic time but don't need high precision as…
sigirisetti
  • 179
  • 1
  • 8
0
votes
2 answers

How many days from now is the Duration?

I have a Duration, like P3M (3 months). How can I get number of days it is from now? All I have now is this: Duration.parseWeekBasedPeriod("P3M") I know the period parameter will never be shorter than 1 week, so parseWeekBasedPeriod() should be ok.…
Pitel
  • 4,588
  • 5
  • 34
  • 65
0
votes
1 answer

get number of days in month with time4j

Is there a way to get number of days in a month using time4j lib? in android default calendar, we can get it so simple like below Calendar calendar=Calendar.getInstance(); int numOfDaysInMonth=calendar.getActualMaximum(Calendar.DAY_OF_MONTH);…
max
  • 5,014
  • 11
  • 37
  • 66
1
2