Browsing Questions About jodatime (1)
Decimal DateTime formatter in Java or Joda
I'm writing a file that requires dates to be in decimal format:
2007-04-24T13:18:09 becomes 39196.554270833331000
Does anyone have a time formatter that will do this (Decimal time is what VB/Office, etc. use)?
Basic code goes like follows:
final DateTime date = new DateTime(2007,…
Approach to convert from org.joda.time.DateTime to java.util.Calendar
Anyone done this and can share? I see an option or two but want to know what others have accomplished.
Are there any cons to using jodatime?
I want to convince the architecture manager to include the joda time jar in our product.
Do you know any disadvantages in using it?
I think joda time needs to be constantly updated because of the files that it includes. And that is a disadvantage. Maybe I am wrong.
Could you provide some …
Find DST transition timestamp with java.util.TimeZone
Is it possible to get the previous and next DST transition timestamp with the Java Calendar/Date/TimeZone API?
With Joda-Time I can write:
DateMidnight today = new DateMidnight(2009, 2, 24);
DateTimeZone zone = today.getZone();
DateTime previousTransition =
new DateTime(zone.previousTransit…
Should I use Java date and time classes or go with a 3rd party library like Joda Time?
I'm creating a web based system which will be used in countries from all over the world. One type of data which must be stored is dates and times.
What are the pros and cons of using the Java date and time classes compared to 3rd party libraries such as Joda time ? I guess these third party lib…
Best practice for ignoring year in date for date ranges
I need to model some information about seasons, and need to track them based on start / end date in a year-agnostic way. I.e. I need to allow users to define summer as being between, say, May 15th and September 10th, and do that for all years.
I'll need to do a lot of checking of the type isTh…
Joda-time: First day in this year's ISO week 1
I would like to find out the date of the Monday in this year's ISO week 1 (For 2009 this would be Monday, Dec 29 2008).
I'm sure that joda-time can handle this, but I just can't figure out the API (maybe it's just too late).
Can anyone help? Thanks!
DateTime is within in interval in JodaTime
Is there a API method in JodaTime to see whether a DateTime is within [start, end], i.e. the boundary is included?
Only thing I found was
new Interval(start, end).contains(dateTime) but this seems to give false if dateTime equals end.
Adding a number of days to a JodaTime Instant
I'm trying to write a simple utility method for adding aninteger number of days to a Joda time instant . Here is my first stab.
/**
* Adds a number of days specified to the instant in time specified.
*
* @param instant - the date to be added to
* @param numberOfDaysToAdd - the number of day…
Can I construct a jodatime.Duration object with milliseconds resolution?
The API doesn't seem promising.
How to use JodaTime with java.sql.Timestamp
I Have a prepared statement
INSERT INTO mst(time) VALUES (?);
where time is of type Timestamp in a PostgreSQL database.
I am inserting a Joda DateTime object, or I should say I am trying to. I can find no way to convert the DateTime ovject into a java.sql.Timestamp. I have read the Joda do…
Java Joda Time - Implement a Date range iterator
I'm trying to implement without success a Date iterator with Joda time.
I need something that allows me to iterate all the days form startDate to endDate
Do you have any idea on how to do that?
How do I create a new Joda DateTime truncated to the last hour?
I am pulling timestamps from a file that I want to create a new DateTime for, but I want to create the DateTime at the floor of the hour (or any Joda Period will do).
How Can I do this?
format years bc/ac differently
I would like to display e.g. 31-12-1999 for years ac and 31-12-(-)2000 for years bc.
I spent some time with the joda api's e.g. something like:
new DateTimeFormatterBuilder().appendYear(4, 10).appendLiteral("-").appendMonthOfYear(2).appendLiteral("-").appendDayOfMonth(2).toFormatter();
but …
Date and Time helper for PHP (like Joda-Time in Java)
I am looking for a library (open source) like Joda-Time in the Java world. Is there any library like that?
Joda-Time is very helpful to calculate date and time. I can add days, weeks, month, year and also can converting date and time easily.
I wish there is library like Joda-Time for PHP.
…
Next Page >