date

Make all sundays Red on month calendar in c#

Hi, i was wondering if anyone knows how to make all sundays on the .net month calendar have the back colour of red? ...

PHP simple date question

Function echo date( "m/d/Y h:i a", "10/22/2009 12:32 am" ); Output 12/31/1969 07:00 pm Why is my output not giving me the correct date, what am I doing wrong? ...

Add 30 days for date in db

I have publish up date and publish down date in my DB. Currently they are both same dates. How do I change it (during mysql insert) so publish down date is 30 days past publish up date. I am using $pubDate Thanks ...

Problem to represent midnight for 01 May 1921 by java.util.Date class

I want to represent midnight by java.util.Date class. To check this I output this value and obtain unexpected result. The code follows: Calendar calendar = new GregorianCalendar(1921, 4, 1, 0, 0); Date date2 = calendar.getTime(); System.out.println(date2); I obtain the following output: Sun May 01 00:20:08 EET 1921 But I expect to...

What's the rationale behind the HTTP Date header?

I have read RFC 2616, but still I wonder, what the Date field is for. There is the Last-Modified field, that actually has a meaning besides just serving metadata, that is, for caching ('If-Modified-Since'). But what use has it to double the info in a separate Date header? ...

GMT vs UTC dates

Hi, I have a calendar build in JS that compares dates with PHP. The JS date object is set using PHP but when I compare future dates they appear to be out of sync. PHP is set to GMT and JS is set to UTC, how do these standards differ and could this be causing the problem? Thanks ...

how to format date coming from MYSQL

Hi Simple question but i need it :) $query = "SELECT * FROM `set` WHERE ID = '$id'"; $result = mysql_query($query); $info = mysql_fetch_assoc($result); $frmdate = $info['date']; So far i tried $timestamp = strtotime($info['date']); $joined_date = date("j M. Y", $timestamp); but no luck ! "date" field in mysql is DATE data ...

Monthly categories with MySQL DATE Type.

Hello, I'm building a mini news CMS where the news added are sorted using a DATE type column e.g. INSERT date_posted=NOW(), etc. I can then easily list out all the available months with: SELECT DATE_FORMAT(date_posted, '%M %Y') as date_posted. This makes the monthly categories list. The issue I'm having is with displaying all the news ...

Which method should I use?

I'm an intermediate java coder, writing a librarian Java app, and for some reason I just can't figure out whether I should use dueDate.after(today) OR dueDate.before(today) method as to deciding if the book is overdue. I've gotten quite some contradictory values by typing both the methods. Hence, I'm also assuming there is some other bug...

javascript date object :Error while using addDays function

I was trying to execute the below code in my javascript and got some exception var now3 = new Date(); now3.addDays(-4); Error throwed is Microsoft JScript runtime error: Object doesn't support this property or method I m using jQuery 1.3.2 in my page . Whats wrong with this? Please help ...

How to explode date from a string using php preg_match and regex

I am processing strings with a date somewhere in it. There are different ways the date can appear in this string: "… 01.11.2009 18:00-21:00 …" or "… 01.11.2009 18:00-02.11.2009 15:00 …" or "… 01.11.2009 18:00 …" Regardless how the date appears I only need the beginning date "01.11.2009 18:00". So if there are two matches it's just...

Watch Date in Eclipse for Java Application

I have been trying to add to the Watch window a Java Date object (java.util.Date). Sometimes, when i hover over a Date in the source editor view, it shows the Date value in a readable format (e.g. 2009 Oct 26 14...) but sometimes, it just does not show the Date value but it only shows the declaration of the date variable/identifier. So a...

Any tips on localizing dates in .NET or in general?

I understand different cultures specify dates differently. Some put day before month (27/10/2009 vs. 10/27/2009) and others use dots instead of slashes (10.27.2009 vs. 10/27/2009). However, is there anything special that needs to be done regarding the year? Do non-Christian cultures refer to the same numeric year (2009) as Christian c...

Excel AVERAGEIF with TODAY() function as criteria

I have values in column c that i want averaged if they occurred in the last seven days (corresponding dates in column a). i can't get the averageif function to work properly, as I need each individual piece of data to be evaluated separately if it falls within the last seven days. this seems like a function that would be used all the tim...

Joda-Time: How to get the next friday?

How can I get the next friday with the Joda-Time API. The LocalDate of today is today. It looks to me you have to decide whever you are before or after the friday of the current week. See this method: private LocalDate calcNextFriday(LocalDate d) { LocalDate friday = d.dayOfWeek().setCopy(5); if (d.isBefore(friday)) { return d.dayO...

iPhone + SQLite3 + fetch date column

Hi, I am having a date column in my table and I want to fetch that in iPhone application, I use following method to fetch values: objPlayer.type = sqlite3_column_int(selectstmt, 1); Now I can't find something like sqlite3_column_date. Which is the method I can use for this purpose. ...

PHP: get next 13 dates from date?

I am trying to get an array of a date plus the next 13 dates to get a 14 day schedule starting from a given date. here is my function: $time = strtotime($s_row['schedule_start_date']); // 20091030 $day = 60*60*24; for($i = 0; $i<14; $i++) { $the_time = $time+($day*$i); $date = date('Y-m-d',$the_time); array_push($dates,$dat...

Get the next xx:30 time (the next half-past hour) after a specified time

I'm trying to find a MySQL query which will obtain the time that is the next half-past-the-hour from a specified datetime. I explicitly mean the next half-past-the-hour, not the next half-hourly point. So for instance: If the datetime was "2009-10-27 08:15:24", the answer would be "2009-10-27 08:30:00" If the datetime was "2009-10-27 ...

Convert two-digit year to four-digit year in Ruby

I have strings like "84", "03" etc. that I want to convert to Date objects, but Date.new only takes the expanded 4-digit year as a parameter. I know it's simple to do, but I don't want to reinvent this wheel. Is there something that does this already? Either in standard Ruby or in ActiveSupport. ...

How to calculate time passed with PHP or Zend_Date?

I'm trying to create a view helper that will display the number of minutes, hours, or days that have passed since...right now. I'm not really sure how to do it. It looks like the date comparison is working, but I don't know how to get the number. Here's what I have so far: <?php class Zend_View_Helper_RecentDate { public function r...