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.

calendar
54 votes
18 answers
442k views

How to change date format (MM/DD/YY) to (YYYY-MM-DD) in date picker

I have following datepicker script: <script> $(function(){ $("#to").datepicker(); $("#from").datepicker().bind("change",function(){ var minValue = $(this).val(); ...
John Ken's user avatar
  • 962
54 votes
4 answers
46k views

Calendar add() vs roll() when do we use it?

I know add() adds the specified (signed) amount of time to the given time field, based on the calendar's rules. And roll() adds the specified (signed) single unit of time on the given time field ...
Pentium10's user avatar
  • 207k
52 votes
10 answers
58k views

How can I select all of the Sundays for a year using Python?

Using Python... How can I select all of the Sundays (or any day for that matter) in a year? [ '01/03/2010','01/10/2010','01/17/2010','01/24/2010', ...] These dates represent the Sundays for 2010. ...
rmontgomery429's user avatar
51 votes
4 answers
145k views

Java: How do you convert a UTC timestamp to local time?

I have a timestamp that's in UTC and I want to convert it to local time without using an API call like TimeZone.getTimeZone("PST"). How exactly are you supposed to do this? I've been using the ...
Android Noob's user avatar
  • 3,321
50 votes
19 answers
69k views

Android Days between two dates

I want to compare two dates for my Android application, but I got a really weird issue. For example: If I set the back in the past date to 127 days ago: this.dateEvent = System.currentTimeMillis() -...
Manitoba's user avatar
  • 8,622
50 votes
14 answers
113k views

How do I discover the Quarter of a given Date?

Given a java.util.Date object how do I go about finding what Quarter it's in? Assuming Q1 = Jan Feb Mar, Q2 = Apr, May, Jun, etc.
Allain Lalonde's user avatar
50 votes
10 answers
149k views

How to get last month/year in java?

How do I find out the last month and its year in Java? e.g. If today is Oct. 10 2012, the result should be Month = 9 and Year = 2012. If today is Jan. 10 2013, the result should be Month = 12 and Year ...
ajm's user avatar
  • 13.1k
50 votes
5 answers
11k views

Converting to and from Hindu calendar

How can I convert unix time to Hindu calendar­Wikipedia time and the other way round in php, Perl or Python or Java? I know I can convert to Hebrew and Jewish. But Hindu is not an option. To be ...
www.data-blogger.com's user avatar
48 votes
3 answers
178k views

How to change TIMEZONE for a java.util.Calendar/Date

I would like to change the TIMEZONE value in a Java Calendar instance at runtime. I tried below. But the output is the same in both instances: Calendar cSchedStartCal = Calendar.getInstance(...
Kanagavelu Sugumar's user avatar
48 votes
7 answers
20k views

Design question: How would you design a recurring event system? [closed]

If you were tasked to build an event scheduling system that supported recurring events, how would you do it? How do you handle when an recurring event is removed? How could you see when the future ...
Joe Van Dyk's user avatar
  • 6,910
47 votes
9 answers
58k views

How to check if a date Object equals yesterday?

Right now I am using this code Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(...
tzippy's user avatar
  • 6,598
47 votes
7 answers
54k views

Moon / Lunar Phase Algorithm

Does anyone know an algorithm to either calculate the moon phase or age on a given date or find the dates for new/full moons in a given year? Googling tells me the answer is in some Astronomy book, ...
Scott Bailey's user avatar
  • 8,128
47 votes
9 answers
80k views

Getting Year, Month and Date in Android

I am trying to get today's Year, Month and Date using following code; Calendar calendar = Calendar.getInstance(); int thisYear = calendar.get(Calendar.YEAR); Log.d(TAG, "# thisYear : " + thisYear); ...
Eranga Peris's user avatar
45 votes
2 answers
21k views

java.lang.IllegalArgumentException: Bad class: class java.util.GregorianCalendar

I received this exception while using GregorianCalendar java.lang.IllegalArgumentException: Bad class: class java.util.GregorianCalendar Who know how to fix, Please help me. p/s : I used the ...
Huy Tower's user avatar
  • 7,904
44 votes
17 answers
51k views

NSCalendar first day of week

Does anyone know if there is a way to set the first day of the week on a NSCalendar, or is there a calendar that already has Monday as the first day of the week, instead of Sunday. I'm currently ...
Joshua's user avatar
  • 839

15 30 50 per page
1
3 4
5
6 7
917