I want two dates.  1) Current date in MM/dd/yy format 2) Modified date which will be the adition of five business days(Mon-Fri) to current date and it should be in MMM dd, yyyy format.  So if my current is 9th june than currentDate should be 06/09/14 and modifiedDate should be Jun 13, 2014.  How to do this?
1510
I'm working with a date in this format: yyyy-mm-dd.  How can I increment this date by one day?
76394
I need to do a date comparison in Mysql without taking into account the time component i.e. i need to convert '2008-11-05 14:30:00' to '2008-11-05'  Currently i am doing this:  SELECT from_days(to_days(my_date))   Is there a proper way of doing this?
8485
Our business has a requirement to calculate a due date on a case by using the created date and adding business hours, or business days. When we calculate business days it converts the days to 24 hours and divides the result by the business hours(10 hours) which is giving us wrong due dates.   Example:  If our created date is today(8/5/16) and we add 5 business days it converts it to 120 hours. It then divides the hours by the business hours which is 12 business days and adds that to the created date which is incorrect.  Is there anyway to make the days convert to amount of time in a business day(which could be dynamic based on BusinessHours) instead of 5 business days being 5 24 hours days?  Heres the code we have currently:  Long interval = c.CreatedDate.addDays(Integer.valueOf(amountOfTimeString)).getTime() - c.CreatedDate.getTime(); c.SLA_Due_Date__c = BusinessHours.add(bh.Id, c.CreatedDate, interval);   I would wish to avoid dividing the interval by a magic number and have it instead be dynamic by the BusinessHours.  Any help would be great  BusinessHours API:    Edit: adding complete method of snippet  private static Boolean setDate(Object amountOfTime, Object timeType, Case c, BusinessHours bh, SObject referenceObject) {     Decimal amountOfTimeString = (Decimal) amountOfTime;     String timeTypeString = (String) timeType;     if(!String.isEmpty(String.valueOf(amountOfTimeString))) {         if(timeTypeString == 'Business Hours') {             Long interval = c.CreatedDate.addHours(Integer.valueOf(amountOfTimeString)).getTime() - c.CreatedDate.getTime();              c.SLA_Due_Date__c = BusinessHours.add(bh.Id, c.CreatedDate, interval);         } else if(timeTypeString == 'Calendar Hours') {             c.SLA_Due_Date__c = c.CreatedDate.addHours(Integer.valueOf(amountOfTimeString));         } else if(timeTypeString == 'Business Days') {             System.debug('Amount of time string: ' + amountOfTimeString);             Long interval = c.CreatedDate.addDays(Integer.valueOf(amountOfTimeString)).getTime() - c.CreatedDate.getTime();             System.debug('Created Date: ' + c.CreatedDate);             c.SLA_Due_Date__c = BusinessHours.add(bh.Id, c.CreatedDate, interval);         } else if(timeTypeString == 'Calendar Days') {              c.SLA_Due_Date__c = c.CreatedDate.addDays(Integer.valueOf(amountOfTimeString));         }          return true;     }     return false; }
17462
I find it curious that the most obvious way to create Date objects in Java has been deprecated and appears to have been "substituted" with a not so obvious to use lenient calendar.  How do you check that a date, given as a combination of day, month, and year, is a valid date?  For instance, 2008-02-31 (as in yyyy-mm-dd) would be an invalid date.
49528
How can two dates be compared in a shell?  Here is an example of how I would like to use this, though it does not work as-is:  todate=2013-07-18 cond=2013-07-15  if [ $todate -ge $cond ]; then     break fi                              How can I achieve the desired result?
63910
I want to set a custom time in ubuntu 14.04   lets say : 8 OCT 2010 18:00:00  wrkstn@wrkstn-VirtualBox:~$ sudo date --set="8 OCT 2006 18:00:00" Sun Oct  8 18:00:00 PETST 2006 wrkstn@wrkstn-VirtualBox:~$ date Fri Sep  2 01:21:51 PETT 2016 wrkstn@wrkstn-VirtualBox:~$    But i am not able to set custom date with Date command. Please Tell me how can i accomplish this.
99127
Is there a function or method to give the last day of a month? For example if the date is 27 feb 2013, the last date should be 28 feb 2013 , it become 29 if its a leap year. if the date was 2 jan then it should return 31 Jan.  If there is no function then any ideas on how we can get this?  Thanks
57923
I wanted to use this, but I don't know if it's actually valid in English:     The specified date is invalid.It points to a non-existing day.   I'm not a native speaker, and I just want to say that the input points to a date that does not exist, like 30th February.
109269
I need to change cell dates with a general format (mm/dd/yy) to a text format for uploading to Peoplesoft. However I must retain the mm/dd/yy. When I change the cell from general format to text format it then changes the date to a serial number date such as 41982 etc. I don't want the serial number date. It must remain a text format cell with mm/dd/yy or mm/dd/yyyy etc.
122568
My system uses the date format dd-MMM-yyyy. Most of the dates on SE/SO sites are formatted as MMM-dd-'yy.  Having only 'yy makes it especially hard to search for years. yyyy would make that a lot easier.  It would be really cool if this became user-configurable; I personally like the ISO 8601 format very much.  No matter what, the default should change; only about 33% of SE users are from the USA, and only about 20% of SO users are. So it makes sense to go for a form of DMY, as that is what most of the world uses.  Edit:
45803
I am trying to show the current date in my JSP page using JSTL. below is the code I am using.  &lt;jsp:useBean id="now" class="java.util.Date" scope="request" /&gt; &lt;fmt:formatDate value="${now}" pattern="MM.dd.yyyy" /&gt;   But the above code is not producing any results? Am I missing anything here or is there any better approach for this? I am using JSTL 1.1.
102155
Background When a date is to be shown that is from this year it is shown as &quot;Mar 12&quot; for the &quot;12th of March&quot; rather than &quot;Mar 12 '14&quot;. While the full form is not what I'm used to (as a European) it is at least unambiguous. However &quot;Mar 12&quot; reads as &quot;March 2012&quot; to me and confuses me every time. Although I have (after months of pain) stopped misreading it I still feel the Parse Error: Needs Stack Exchange Mode and the slight pause as my brain tried to reparse it. The most recent example of someone confused by this is here . I was myself caught by this . Feature request Even for recent dates; once the date is shown at all show the full date including the year. So this post was posted on Mar 22 '14. This seems to have no downsides as it takes no extra space (there needs to be space for the long form anyway) and is much clearer to those of us who don't use an American date system.
106787
Suppose I have a date, i.e. year, month and day, as integers. What's a good (correct), concise and fairly readable algorithm for computing the   of the week the given date falls into? I have come across some truly horrendous code that makes me think surely there must be a better way.  I'm looking to do this in Java but psuedocode for any kind of object-oriented language is fine.
97131
What is the correct way to express the following? The original meeting time was 9 AM. And it was later re-scheduled to 16 PM.  Is the following expression correct, if not, what would it be?      The meeting was re-scheduled for 16 to 17PM.
93098
In SQL Server, how do I "floor" a DATETIME to the second/minute/hour/day/year?  Let's say that I have a date of 2008-09-17 12:56:53.430, then the output of flooring should be:   Year:  2008-01-01 00:00:00.000 Month: 2008-09-01 00:00:00.000 Day: 2008-09-17 00:00:00.000 Hour: 2008-09-17 12:00:00.000 Minute: 2008-09-17 12:56:00.000 Second: 2008-09-17 12:56:53.000
60004
Is it possible to convert a timestamp to a date format in a query?  This is the code I am using.  $query = db_select('my_submissions', 's'); $query-&gt;fields('s', array('sid','name','company','email','phone','is_customer','submitted','count')); $entries = $query-&gt;execute();  $rows = array(); foreach ($entries as $entry) {   $row = array_map('check_plain', (array) $entry);   $row['submitted'] = $row['submitted'] ? date('d.m.Y H:i', $row['submitted']) : "";   $rows[] = $row; }
7801
In general, there is a difference between the common spoken ordering of dates between US and UK usage. So in the UK, we would tend to say:     "the 14th of December, 2005"   while in the US, people would tend to say:     "December 14th, 2005"   The US ordering is possible in spoken usage (usually with "the", so "December the 14th, 2005"), but probably not the most common in spoken usage, and definitely not in written usage. In written UK usage-- at least in a modern written style-- one would tend to write: "14 December 2005".  Now my question: how jarring does it look to a native US speaker to write dates using the UK format, i.e. "14 December 2005"? Visually, I quite like the UK style because it keeps the two numbers separated, but the document I'm writing is for a US audience.