date

MYSQL - Retrieve Results by Date Proximity

Hi All! ;-) my question is: assuming we have a calendar_table with UNIX datestamp date_column, i want retrieve the event with the closest proximity to the today date. So, for example if there is no event today, keep the closest one based on it's date! UPDATED probably i need to be more clear, i need to retrieve not just one event, b...

Check file stamp using FTP to see if it is today's file.

Hi, I am using FTP (plain version) to download files from a server. The name of the file is always the same. All I can do to check to know if it is today's file is look at the timestamp manually. How can I write FTP script to check if the time stamp is having today's date? If you have come across this situation and have solved it, plea...

The woes of (sometimes) storing "date only" in datetimes

We have two fields from and to (of type datetime), where the user can store the begin time and the end time of a business trip, e.g.: From: 2010-04-14 09:00 To: 2010-04-16 16:30 So, the duration of the trip is 2 days and 7.5 hours. Often, the exact times are not known in advance, so the user enters the dates without a time: From: ...

C++: Converting Julian dates to Gregorian

I need to write a function that converts a Julian dates (Year, Day of Year, Hour of Day and Minutes) into a standard form (Year, Month, Day of Month, Hour of Day and Minutes) and express it as a string. I figure there's got to be someone who's already written a library or component which can do the conversion from Day Of Year to Month a...

(php) date and time

(php) how to get date and time into one string ($moment) and if it works, can mysql do this: SELECT * FROM table ORDER BY moment ASC ? ...

Unix timestamp and mysql date: birthdate

Hi, I have a really basic question concerning unix timestamp and mysql date. I'm trying to build a small website where users can register and fill in their birthdate. Problem is that unix starts with Jan 01 1970. Now if i calculate age for users, form dates like date('m.d.Y', $unix_from_db) and so on it will fail with users older that 4...

Convert 2010-04-16 16:30:00 to "Tomorrow Afternoon".

Convert 2010-04-16 16:30:00 to "Tomorrow Afternoon" or convert another date to "this afternoon", "next year", "next week wednesday". You get the picture. Anyone know of a PHP or Javascript library that can do this? ...

Better way of creating a PHP future date

Is there a quicker way of creating a date such as: echo date('Y-m-d', mktime(0, 0, 0, date("m"), date("d")+3, date("Y"))); Thanks if you can help. ...

How to fetch UTC dates with JavaScript?

I want to get the current UTC date with Javascript. How can I do this? There seems to be methods for getting the time in UTC: date.getUTCHours(); How can I get the date? ...

How to get date in specific locale with JavaScript?

I need to get the date in a specific locale using JavaScript - not necessarily the user's locale. How can I do this? I did some research and found date.getUTCMonth() and date.getUTCDate(). How can I use this or something else to get the date in a certain locale? ...

Javascript check if it has passed midnight since a certain time

I need to create a javascript function that checks if it has been a day since timeX (an instance of Date). I do NOT mean whether is has been 24 hours since timeX, but instead whether it has passed a midnight since timeX. I am a PHP expert, not a JavaScript one, so I was wondering if anyone here had any quick answers. Thanks! function...

In SSRS what is the correct way to change a date from the standard "d" offered in the properties to a custom one?

I have a date as shown in expression: = Fields!last_sales_date.Value will show: 04/16/2010 Applying standard date properties allows only a few ways to display this date. I don't want to use the system dates supplied. What is the correct way to customize the display format to the following: Want to show: 4/16/10 Using VS 2003 ...

How to get year, month, day, hours, minutes, seconds and milliseconds of the current moment in Java?

I would like to have them as strings. ...

How to determine whether a spread-sheet cell contains a date, or a real number?

When a cell in a spreadsheet contains a simple date (mm/dd/yyyy) the poi API flags the cell-type as 'numeric'. This is probably because spreadsheets ( IMO ) historically recognize only strings and real numbers. It is possible to hard-code the cell-index, and use it conditionally to call 'getDateCellValue'. But this feels like a hack. ...

i have a date (eg: 2010-04-17 ) i need the date of after 20 days from this date

i have a date (eg: 2010-04-17 ) i need the date of after 20 days from this date How to get the date after 20 days i.e next month some date. either in sql or in c# ...

Algorithm to generate dates for business days given the range of dates

I'd like to be able to calculate the dates of business days (mon-fri) given two dates d1 and d2. However in some locales the business days are sat-wed or sun-thur. Is there a facility in STL or C++ in general that allows for such a calculation? ...

Parsing to a total DateTime object in Rails

I'm currently given three values in a table A date value in the format of %dd-%mname-%yy (i.e 06-may-05), and am parsing that using Date.parse(input,true) to fix the issue with the leading values. I'm then given a time value in the form of %hh:%mm:%ss.%ms (the ms of which I can take or leave) and a third value of a GMT offset. I can't...

Parsing date in Pascal

Hello, what's the better way of parsing date in Pascal than manually parsing character after character? Date should be in mm.dd.yyyy format. ...

MySQL date query only returns one year, when multiple exist

I'm a part-time designer/developer with a part-time photography business. I've got a database of photos with various bits of metadata attached. I want to query the database and return a list of the years that photos were taken, and the quantity of photos that were taken in that year. In short, I want a list that looks like this: 2010 (...

PHP - Convert to date format dd/mm/yyyy

Hi there! I have the following date: 2010-04-19 18:31:27. I would like to convert this date to the dd/mm/yyyy format. Can anyone give me some help? Thanks in advance for the help, Best regards! ...