Skip to main content

Questions tagged [calendar]

A calendar is a system of reckoning time in which the beginning, length and divisions of a year are defined. The term may refer to a software class or library for the manipulation and display of calendar data, or to a list of events with associated dates and times, managed by a human via an application or operating system user interface.

68 votes
3 answers
88k views

Difference between EST and America/New_York time zones

Can somebody please tell, what's the difference between the following two statements: TimeZone.getTimeZone("America/New_York") and TimeZone.getTimeZone("EST") In other words, why is EST different ...
Gaurav's user avatar
  • 1,610
68 votes
11 answers
190k views

Get first date of current month in java

I am trying to get to and from date where ToDate will have previous date and FromDate will have first date of the current month. For January it would be 1/1/2013 and so on. How to get the first date ...
user avatar
65 votes
8 answers
134k views

How to tackle daylight savings using TimeZone in Java

I have to print the EST time in my Java application. I had set the time zone to EST using: Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("EST")); But when the daylight savings is being ...
Surya Chandra's user avatar
63 votes
5 answers
134k views

How to convert a date String to a Date or Calendar object?

I have a String representation of a date that I need to create a Date or Calendar object from. I've looked through Date and Calendar APIs but haven't found anything that can do this other than ...
Aaron's user avatar
  • 23.7k
63 votes
9 answers
54k views

Convert Date from Persian to Gregorian

How can I convert Persian date to Gregorian date using System.globalization.PersianCalendar? Please note that I want to convert my Persian Date (e.g. today is 1391/04/07) and get the Gregorian Date ...
Mahdi Tahsildari's user avatar
61 votes
21 answers
69k views

How to convert time to " time ago " in android

My server. It return time : "2016-01-24T16:00:00.000Z" I want 1 : convert to String. 2 : I want it show " time ago " when load it from server. Please. Help me!
anh thang Bui's user avatar
61 votes
2 answers
2k views

Publishing Outlook Calendars. What is the server-side setting for sync frequency?

I'm working on a custom implementation of a server (VERY basic WebDAV) that accepts Outlook's published calendars. Outlook seems to have a setting (see the screenshot below) where it accepts a ...
Mihail Russu's user avatar
  • 2,526
60 votes
27 answers
209k views

Leap year calculation [closed]

In order to find leap years, why must the year be indivisible by 100 and divisible by 400? I understand why it must be divisible by 4. Please explain the algorithm.
user avatar
60 votes
5 answers
31k views

A good date converter for Jalali Calendar in Java? [closed]

I'm developing a Java App and I have a timeStamp (in long). I can easily use this code to change it to a Gregorian date: Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(timeStamp)...
Saeed's user avatar
  • 7,360
60 votes
5 answers
58k views

Python: Converting from `datetime.datetime` to `time.time`

In Python, how do I convert a datetime.datetime into the kind of float that I would get from the time.time function?
Ram Rachum's user avatar
  • 87.1k
59 votes
8 answers
37k views

Start of week for locale using Joda-Time

How do you determine which day of the week is considered the “start” according to a given Locale using Joda-Time? Point: Most countries use the international standard Monday as first day of week (!). ...
stolsvik's user avatar
  • 5,301
58 votes
7 answers
54k views

Laying out a database schema for a calendar application

I want to write a calendar application. It is really recurring items that throw a wrench in the works for the DB schema. I would love some input on how to organize this. What if a user creates an ...
Anthony D's user avatar
  • 11.1k
55 votes
3 answers
157k views

Why Java Calendar set(int year, int month, int date) not returning correct date? [duplicate]

According to doc, calendar set() is: http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html#set%28int,%20int,%20int%29 set(int year, int month, int date) Sets the values for the ...
Meow's user avatar
  • 19k
55 votes
4 answers
153k views

Get date in current timezone in Java

I have been searching over the net from past few hours to get the datetime in my system timezone. When I use calendar.getTimezone.getDefaultName()it always returns me GMT. Ideally it should return my ...
Kiran Kulkarni's user avatar
54 votes
8 answers
201k views

Set Date in a single line

According to the Java API, the constructor Date(year, month, day) is deprecated. I know that I can replace it with the following code: Calendar myCal = Calendar.getInstance(); myCal.set(Calendar.YEAR,...
hibernate's user avatar
  • 747

15 30 50 per page