Questions tagged [apache-commons-dateutils]

A helper class from Apache commons-lang used for manipulations of Dates or Calendars.

A helper class from Apache commons-lang used for manipulations of Dates or Calendars.

The project Home Page: http://commons.apache.org/proper/commons-lang/.

18 questions
0
votes
4 answers

DateUtils#truncate() to work in UTC timezone

I have a java.util.Date on which i am using org.apache.commons.lang.time#truncate(javaUtilDateObj, Calendar.DATE) to convert the date to midnight. The problem is the UTC date gets represented in local timezone and the truncate method just converts…
maverick
  • 549
  • 2
  • 10
  • 18
0
votes
2 answers

Parseing strictly date with SimeplDateFormat

I'm trying to parse a date but I only get an ParseException. I'm working with the Apache DateUtils. The code with the date that I'm tryting to parse is: Locale.setDefault(Locale.ENGLISH); System.out.println(Locale.getDefault()); …
Guille
  • 2,248
  • 3
  • 24
  • 42
-1
votes
1 answer

Apache DateUtils not able to parse 2018-03-11 02:00:00 Daylight saving timestamp

public static void main(String[] args){ Date date = null; try { date = DateUtils.parseDateStrictly("2018-03-11 01:59:00", "yyyy-MM-dd HH:mm:ss"); System.out.println(date.getTime()); date =…
Ecnoir
  • 73
  • 1
  • 2
  • 9
1
2