@Test
public void testTruncateKathmandu()
{
final DateTimeZone tz = DateTimeZone.forTimeZone(TimeZone.getTimeZone("Asia/Kathmandu"));
final DateTime date = new DateTime("2011-03-15T21:42:23.898+05:45", tz);
final PeriodGranularity year = new PeriodGranularity(new Period("P1Y"), null, tz);
final PeriodGranularity hour = new PeriodGranularity(new Period("PT1H"), null, tz);
final PeriodGranularity twoHour = new PeriodGranularity(new Period("PT2H"), null, tz);
Assert.assertEquals(
new DateTime("2011-01-01T00:00:00.000+05:45", tz),
year.toDateTime(year.bucketStart(date).getMillis())
);
Assert.assertEquals(
new DateTime("2011-03-15T21:00:00.000+05:45", tz),
hour.toDateTime(hour.bucketStart(date).getMillis())
);
Assert.assertEquals(
new DateTime("2011-03-15T20:00:00.000+05:45", tz),
twoHour.toDateTime(twoHour.bucketStart(date).getMillis())
);
}