Search Results

Search found 15061 results on 603 pages for 'date modified'.

Page 3/603 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Oracle Date Format Convert Hour-Minute to Interval and Disregard Year-Month-Day

    - by dlite922
    I need to compare an event's half-way midpoint between a start and stop time of day. Right now i'm converting the dates you see on the right, to HH:MM and the comparison works until midnight. the query says: WHERE half BETWEEN pStart and pStop. As you can see below, pStart and pStap have January 1st 2000 dates, this is because the year month day are not important to me... Valid Data: +-------+--------+-------+---------------------+---------------------+---------------------+ | half | pStart | pStop | half2 | pStart2 | pStop2 | +-------+--------+-------+---------------------+---------------------+---------------------+ | 19:00 | 19:00 | 23:00 | 2012-11-04 19:00:00 | 2000-01-01 19:00:00 | 2000-01-01 23:00:00 | | 20:00 | 19:00 | 23:00 | 2012-11-04 20:00:00 | 2000-01-01 19:00:00 | 2000-01-01 23:00:00 | | 21:00 | 19:00 | 23:00 | 2012-11-04 21:00:00 | 2000-01-01 19:00:00 | 2000-01-01 23:00:00 | | 23:00 | 20:00 | 23:00 | 2012-11-05 23:00:00 | 2000-01-01 20:00:00 | 2000-01-01 23:00:00 | +-------+--------+-------+---------------------+---------------------+---------------------+ Now observe what happens when pStop is midnight or later... Valid Data that breaks it: +-------+--------+-------+---------------------+---------------------+---------------------+ | half | pStart | pStop | half2 | pStart2 | pStop2 | +-------+--------+-------+---------------------+---------------------+---------------------+ | 23:00 | 22:00 | 00:00 | 2012-11-04 23:00:00 | 2000-01-01 22:00:00 | 2000-01-01 00:00:00 | | 23:30 | 23:00 | 02:00 | 2012-11-05 23:30:00 | 2000-01-01 23:00:00 | 2000-01-01 02:00:00 | +-------+--------+-------+---------------------+---------------------+---------------------+ Thus my where clause translates to: WHERE 19:00 BETWEEN 22:00 AND 00:00 ...which returns false and I miss those two correct rows above. Question: Is there a way to show those dates as integer interval so that saying half BETWEEN pStart and pStop are correct? I thought about adding 24 when pStop is less than pStart to make 00:00 into 24:00 but don't know an easy way to do that without long string concatenations and number conversions. This would solve the problem because pStart pStop difference will never be longer than 6 hours. Note: (The Query is much more complex. It has other irrelevant date calculations, but the result are show above. DATE_FORMAT(%H:%i) is applied to the first three columns and no formatting to the last three) Thanks for your help:

    Read the article

  • UIDatePicker date method is picking wrong date: iPhone Dev

    - by prd
    Hi, I am getting very strange behaviour on UIDatePicker. I have a view with date picker declared in .h file as IBOutlet UIDatePicker *datePicker; with property nonatomic and retain. datePicker is properly linked in IB file. In the code I am setting the minimum, maximum, initial date and action to call for UICOntrolEventValueChanged using following code If (!currentDate) { initialDate = [NSDate date]; } else { initialDate = currentdate; } [datePicker setMinimumDate:[NSDate date]]; [datePicker setMaximumDate:[[NSDate date] addTimeInterval:5 * 365.25 * 24 * 60 * 60]]; // to get upto 5 years [datePicker setDate:initialDate animated:YES]; [datePicker addTarget:self action:@selector(getDatePickerValue:) forControlEvents:UIControlEventValueChanged]; In getDatePickerValue, I get the new date using datePicker.date. When the view is closed (using a done button), I get the current value of the date using datePicker.date. Now if the view is called with no 'currentDate', the picker returns 'todays date'. This is what happens the 'first' time my pickerView is called. Each subsequent call to the view, with no 'current date' gives me a different and later date from today. So, first time I get today's date say 9 Jun 2010 second time datePicker.date returns 10 Jun 2010 third time 11 Jun 2010 and so on. Though its not always incremental, but mostly it is. I have put NSLogs, and verified the initial date is set correctly. The problem is only on the device (on OS 3.0), the issue is not replicated on simulator. I can't find what I have done wrong. I hope somebody else has come across similar problem and can help me resolve this.

    Read the article

  • Formating Date in Freemarker to say "Today", "Yesterday", etc.

    - by egervari
    Is there a way in freemarker to compare dates to test if the date is today or yesterday... or do I have to write code in Java to do these tests? I basically want to do this: <#------------------------------------------------------------------------------ formatDate -------------------------------------------------------------------------------> <#macro formatDate date showTime=true> <#if date??> <span class="Date"> <#if date?is_today> Today <#elseif date?is_yesterday> Yesterday <#else> ${date?date} </#if> </span> <#if showTime> <span class="Time">${date?time}</span> </#if> </#if> </#macro> EDIT: My best guess to implement this is to pass "today" and "yesterday" into the model for the pages that use this function and then compare the date values against these 2 objects in the model. I am out of out of options, but I'd rather not have to do this for every page that uses this macro. Any other options that are nicer? <#if date??> <span class="Date"> <#if date?date?string.short == today?date?string.short> Today <#elseif date?date?string.short == yesterday?date?string.short> Yesterday <#else> ${date?date} </#if> </span> <#if showTime> <span class="Time">${date?time}</span> </#if> </#if>

    Read the article

  • Parse git log by modified files

    - by MrUser
    I have been told to make git messages for each modified file all one line so I can use grep to find all changes to that file. For instance: $git commit -a modified: path/to/file.cpp/.h - 1) change1 , 2) change2, etc...... $git log | grep path/to/file.cpp/.h modified: path/to/file.cpp/.h - 1) change1 , 2) change2, etc...... modified: path/to/file.cpp/.h - 1) change1 , 2) change2, etc...... modified: path/to/file.cpp/.h - 1) change1 , 2) change2, etc...... That's great, but then the actual line is harder to read because it either runs off the screen or wraps and wraps and wraps. If I want to make messages like this: $git commit -a modified: path/to/file.cpp/.h 1) change1 2) change2 etc...... is there a good way to then use grep or cut or some other tool to get a readout like $git log | grep path/to/file.cpp/.h modified: path/to/file.cpp/.h 1) change1 2) change2 etc...... modified: path/to/file.cpp/.h 1) change1 2) change2 etc...... modified: path/to/file.cpp/.h 1) change1 2) change2 etc......

    Read the article

  • Change the format of the date column in Thunderbird

    - by TheOmega
    I want to change the format of the "Date"-column in the messagelist in Thunderbird. For mails from today, I want to display only the time, not the date. For mails from before today, I want to display only the date, not the time. This is the same setup mutt uses. I know of the Date display format wiki article, which describes how to change the date format, but you can only switch between five predefined formats, and none of them is "Date only". I also know of the ConfigDate extension, but it's got the same limitations, you can't define a new date format.

    Read the article

  • How to parse date from string ?

    - by Harikrishna
    I want to parse the date from the string where date formate can be any of different format. Now to match date we can use DateTime.TryParseExact and we can define format as we needed and date will be matched for any different format. string[] formats = {"MMM dd yyyy"}; DateTime dateValue; string dateString = "May 26 2008"; if (DateTime.TryParseExact(dateString, formats, new CultureInfo("en-US"), DateTimeStyles.None, out dateValue)) MessageBox.Show(dateValue.ToString()); This matches with date.But this is not working for parse the date from the string that is it does not matched with the date which is in some string. Like if the date is "May 26 2008" then we can define format "MMM dd yyyy" and date will be matched. But if date is in some string like "Abc May 26 2008" then date will not be matched.So for that can we use regular expression here ? If yes how ?

    Read the article

  • Sql Server string to date conversion

    - by JosephStyons
    I want to convert a string like this: '10/15/2008 10:06:32 PM' into the equivalent DATETIME value in Sql Server. In Oracle, I would say this: TO_DATE('10/15/2008 10:06:32 PM','MM/DD/YYYY HH:MI:SS AM') This question implies that I must parse the string into one of the standard formats, and then convert using one of those codes. That seems ludicrous for such a mundane operation. Is there an easier way?

    Read the article

  • File modified date/time changes when uploaded via FTP

    - by Nate Shoffner
    Hey /g/, FTP/PHP question here. On one of my pages I load .txt files from a directory. Pretty simple. I also display the modified date of the text file using this: date('m/d/Y', filemtime($file)); This works fine on my WAMP server but when I upload the files via FTP, the modified date is changed to when they were uploaded. I'm currently hosting on a free hosting provider (freehostia to be exact). Is there any way to keep the modified date/time from changing when it's uploaded? Or is there perhaps an alternative way to go about this? Any ideas are appreciated.

    Read the article

  • Date calculation algorithm

    - by Julian Cuevas
    I'm working on a project to schedule a machine shop, basically I've got everything covered BUT date calculations, I've got a method called schedule (working on PHP here): public function schedule($start_date, $duration_in_minutes) Now my problem is, currently I'm calculating end time manually because time calculations have the following rules: During weekdays, work with business hours (7:00 AM to 5:00 PM) Work on Saturdays from 7:00 AM to 2:00 PM Ignore holidays (in Colombia we have A LOT of holidays) I already have a lookup table for holidays, I also have a Java version of this algorithm that I wrote for a previous version of the project, but that one's also manual. Is there any way to calculate an end time from a start time given duration?, my problem is that I have to consider the above rules, I'm looking for a (maybe?) math based solution, however I currently don't have the mind to devise such a solution myself. I'll be happy to provide code samples if necessary.

    Read the article

  • Question on date and timezone in Linux

    - by LinuxPenseur
    Hi , I did the date command and it gave the following output root@localhost:~$ date Thu Dec 30 14:19:47 UTC 2010 Then i modified the date using date -s command whichn gave the following output root@localhost:~$ date -s "12/30/2010 JST 14:19:47" Thu Dec 30 05:19:47 UTC 2010 I noticed that the time changed to 9 hours behind UTC time to show exactly the JST time. But timezone as you can see is still showing UTC. Why is it showing the correct time and incorrect timezone? Thanks

    Read the article

  • Get Browser to send both If-None-Match and If-Modified-Since

    - by Glen
    My Browser isn't sending back an If-Modified-Since Header for PHP generated Content on the first request my script sends: (Status-Line) HTTP/1.1 200 OK Date Thu, 21 Jan 2010 08:55:25 GMT Server Apache/2.2.11 (Win32) PHP/5.2.9-1 X-Powered-By PHP/5.2.9-1 Pragma no-cache x-ua-compatible IE=8;FF=3;OtherUA=4 Last-Modfied Sat, 02 Jan 2010 02:02:20 GMT Content-Length 28453 Etag b98e0795b509be20146f58e06fbb624f Keep-Alive timeout=5, max=90 Connection Keep-Alive Content-Type image/png it on the second request it sends: (Request-Line) GET /kincumberunitingchurch/banner_image.php?id=1 HTTP/1.1 Host localhost User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.17) Gecko/2009122116 Firefox/3.0.17 Accept image/png,image/*;q=0.8,*/*;q=0.5 Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 300 Connection keep-alive Referer http://localhost/kincumberunitingchurch/index.php?sid=tgl9jq3f71nau3cj9vps6pna03 Cookie sid=tgl9jq3f71nau3cj9vps6pna03; PHPSESSID=m0jvven6d7l65pl6odm9ecfnt4 If-None-Match b98e0795b509be20146f58e06fbb624f Cache-Control max-age=0 for other files the sever sends first: (Status-Line) HTTP/1.1 200 OK Date Thu, 21 Jan 2010 08:55:25 GMT Server Apache/2.2.11 (Win32) PHP/5.2.9-1 Last-Modified Wed, 30 Dec 2009 02:40:58 GMT Etag "1000000013d35-40d9-47be9117f6280" Accept-Ranges bytes Content-Length 16601 Keep-Alive timeout=5, max=84 Connection Keep-Alive Content-Type image/png and my browser send the following on the next request: (Request-Line) GET /kincumberunitingchurch/img/cbuttons.png HTTP/1.1 Host localhost User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.17) Gecko/2009122116 Firefox/3.0.17 Accept image/png,image/*;q=0.8,*/*;q=0.5 Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 300 Connection keep-alive Referer http://localhost/kincumberunitingchurch/mystyle.css Cookie sid=tgl9jq3f71nau3cj9vps6pna03; PHPSESSID=m0jvven6d7l65pl6odm9ecfnt4 If-Modified-Since Wed, 30 Dec 2009 02:40:58 GMT If-None-Match "1000000013d35-40d9-47be9117f6280" Cache-Control max-age=0 why would it send the If-Modified-Since header

    Read the article

  • How do I find the Next Closest Date to today from a list of dates in a Plist on iOS?

    - by user1173823
    Situation: In short, I have a football schedule. I would like to use a custom cell which provides more info for only the next game date in the schedule. Issue: How do I find only the next closest game in the schedule (for iOS)? I've watched the WWDC 2013 video for "Solutions to Common Date and Time Issues" however this primarily applies to the Mac. I've searched numerous posts here and some are close but not what I need to find ONLY the next date from my list of dates in the schedule. From other posts I see where I can compare two specific dates, but this is not what I want to do. I want to find the next closest date that is equal to or after today from a list of dates. This is where I am now. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //Populate the table from the plist NSDictionary *season = _schedContentArray[indexPath.section]; NSArray *schedule = season[@"Schedule"]; NSDictionary *game = schedule[indexPath.row]; //find the closest game date after today's date ?? NSString *gameDateStr = game[@"GameDate"]; NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.calendar=calendar; [dateFormatter setDateFormat:@"MM/dd/yy"]; NSDate *today = [NSDate date]; NSDate *gameDate = [dateFormatter dateFromString:gameDateStr]; //NSString *nextGame = NSLog(@"game date is %@",gameDate); The NSLog returns the game dates (except for the open date): 2013-11-11 16:10:05.979 Clemson Football[24060:70b] game date is 2013-08-31 04:00:00 +0000 2013-11-11 16:10:05.982 Clemson Football[24060:70b] game date is 2013-09-07 04:00:00 +0000 2013-11-11 16:10:05.985 Clemson Football[24060:70b] game date is (null) 2013-11-11 16:10:05.987 Clemson Football[24060:70b] game date is 2013-09-19 04:00:00 +0000 2013-11-11 16:10:05.988 Clemson Football[24060:70b] game date is 2013-09-28 04:00:00 +0000 2013-11-11 16:10:05.990 Clemson Football[24060:70b] game date is 2013-10-05 04:00:00 +0000 2013-11-11 16:10:05.992 Clemson Football[24060:70b] game date is 2013-10-12 04:00:00 +0000 2013-11-11 16:10:05.993 Clemson Football[24060:70b] game date is 2013-10-19 04:00:00 +0000 2013-11-11 16:10:05.995 Clemson Football[24060:70b] game date is 2013-10-26 04:00:00 +0000 2013-11-11 16:10:05.996 Clemson Football[24060:70b] game date is 2013-11-02 04:00:00 +0000 2013-11-11 16:10:05.998 Clemson Football[24060:70b] game date is 2013-11-09 05:00:00 +0000 2013-11-11 16:10:06.000 Clemson Football[24060:70b] game date is 2013-11-14 05:00:00 +0000 2013-11-11 16:10:06.001 Clemson Football[24060:70b] game date is 2013-11-23 05:00:00 +0000 2013-11-11 16:10:06.003 Clemson Football[24060:70b] game date is 2013-11-30 05:00:00 +0000 2013-11-11 16:10:06.005 Clemson Football[24060:70b] game date is 2013-12-07 05:00:00 +0000 Thanks in advance for any assistance you can provide. This seems like it should be simple but has been fairly frustrating. Let me know if you need additional info.

    Read the article

  • Difference between LASTDATE and MAX for semi-additive measures in #DAX

    - by Marco Russo (SQLBI)
    I recently wrote an article on SQLBI about the semi-additive measures in DAX. I included the formulas common calculations and there is an interesting point that worth a longer digression: the difference between LASTDATE and MAX (which is similar to FIRSTDATE and MIN – I just describe the former, for the latter just replace the correspondent names). LASTDATE is a dax function that receives an argument that has to be a date column and returns the last date active in the current filter context. Apparently, it is the same value returned by MAX, which returns the maximum value of the argument in the current filter context. Of course, MAX can receive any numeric type (including date), whereas LASTDATE only accepts a column of type date. But overall, they seems identical in the result. However, the difference is a semantic one. In fact, this expression: LASTDATE ( 'Date'[Date] ) could be also rewritten as: FILTER ( VALUES ( 'Date'[Date] ), 'Date'[Date] = MAX ( 'Date'[Date] ) ) LASTDATE is a function that returns a table with a single column and one row, whereas MAX returns a scalar value. In DAX, any expression with one row and one column can be automatically converted into the corresponding scalar value of the single cell returned. The opposite is not true. So you can use LASTDATE in any expression where a table or a scalar is required, but MAX can be used only where a scalar expression is expected. Since LASTDATE returns a table, you can use it in any expression that expects a table as an argument, such as COUNTROWS. In fact, you can write this expression: COUNTROWS ( LASTDATE ( 'Date'[Date] ) ) which will always return 1 or BLANK (if there are no dates active in the current filter context). You cannot pass MAX as an argument of COUNTROWS. You can pass to LASTDATE a reference to a column or any table expression that returns a column. The following two syntaxes are semantically identical: LASTDATE ( 'Date'[Date] ) LASTDATE ( VALUES ( 'Date'[Date] ) ) The result is the same and the use of VALUES is not required because it is implicit in the first syntax, unless you have a row context active. In that case, be careful that using in a row context the LASTDATE function with a direct column reference will produce a context transition (the row context is transformed into a filter context) that hides the external filter context, whereas using VALUES in the argument preserve the existing filter context without applying the context transition of the row context (see the columns LastDate and Values in the following query and result). You can use any other table expressions (including a FILTER) as LASTDATE argument. For example, the following expression will always return the last date available in the Date table, regardless of the current filter context: LASTDATE ( ALL ( 'Date'[Date] ) ) The following query recap the result produced by the different syntaxes described. EVALUATE     CALCULATETABLE(         ADDCOLUMNS(              VALUES ('Date'[Date] ),             "LastDate", LASTDATE( 'Date'[Date] ),             "Values", LASTDATE( VALUES ( 'Date'[Date] ) ),             "Filter", LASTDATE( FILTER ( VALUES ( 'Date'[Date] ), 'Date'[Date] = MAX ( 'Date'[Date] ) ) ),             "All", LASTDATE( ALL ( 'Date'[Date] ) ),             "Max", MAX( 'Date'[Date] )         ),         'Date'[Calendar Year] = 2008     ) ORDER BY 'Date'[Date] The LastDate columns repeat the current date, because the context transition happens within the ADDCOLUMNS. The Values column preserve the existing filter context from being replaced by the context transition, so the result corresponds to the last day in year 2008 (which is filtered in the external CALCULATETABLE). The Filter column works like the Values one, even if we use the FILTER instead of the LASTDATE approach. The All column shows the result of LASTDATE ( ALL ( ‘Date’[Date] ) ) that ignores the filter on Calendar Year (in fact the date returned is in year 2010). Finally, the Max column shows the result of the MAX formula, which is the easiest to use and only don’t return a table if you need it (like in a filter argument of CALCULATE or CALCULATETABLE, where using LASTDATE is shorter). I know that using LASTDATE in complex expressions might create some issue. In my experience, the fact that a context transition happens automatically in presence of a row context is the main reason of confusion and unexpected results in DAX formulas using this function. For a reference of DAX formulas using MAX and LASTDATE, read my article about semi-additive measures in DAX.

    Read the article

  • Minimum and maximum Date in date Picker in iphone

    - by Iphony
    I want to get minimum and maximum date from date picker but minimum date should be "- 18" of current date and maximum date should be "- 100" of current date. Suppose current year is 2018 then I want minimum date 2000 and maximum date 1918. what I have done so far is : NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *components = [gregorian components:NSYearCalendarUnit fromDate:[NSDate date]]; NSInteger year = [components year]; int mindt = year - 18; int maxdt = year -100; // NSDate * MinDate = [components year] - 18; // NSDate * MaxDate = [components year] - 100; // self.datePicker.minimumDate = MinDate; // self.datePicker.maximumDate = MaxDate; but I cant get this integer to my date formate.. pls suggest any way ...

    Read the article

  • Display latest date from a HTML attribute

    - by Tron
    I currently have several classes which contain a date inside an attribute. <div id="container"> <div class="date" date="19/11/2013"></div> <div class="date" date="06/11/2013"></div> </div> <div id="result"></div> What I would like to do, is find the latest date and display it on the page. So far, I've found the information in the attribute, checked that it doesn't exist in the array then and pushed it into an array. I'm not entirely sure of the best approach from here, but ideally i would like to find the latest date and then append it to the results container. $('.date').each(function () { var dateArray = []; var date = $(this).attr('date'); if ($.inArray(date, dateArray) == -1) { dateArray.push(date); } $('#result').append(dateArray); }); Any assistance on the above would be greatly appreciated. Thanks :)

    Read the article

  • Most efficient way of checking if Date object and Calendar object are in the same month

    - by Indigenuity
    I am working on a project that will run many thousands of comparisons between dates to see if they are in the same month, and I am wondering what the most efficient way of doing it would be. This isn't exactly what my code looks like, but here's the gist: List<Date> dates = getABunchOfDates(); Calendar month = Calendar.getInstance(); for(int i = 0; i < numMonths; i++) { for(Date date : dates) { if(sameMonth(month, date) .. doSomething } month.add(Calendar.MONTH, -1); } Creating a new Calendar object for every date seems like a pretty hefty overhead when this comparison will happen thousands of times, soI kind of want to cheat a bit and use the deprecated method Date.getMonth() and Date.getYear() public static boolean sameMonth(Calendar month, Date date) { return month.get(Calendar.YEAR) == date.getYear() && month.get(Calendar.MONTH) == date.getMonth(); } I'm pretty close to just using this method, since it seems to be the fastest, but is there a faster way? And is this a foolish way, since the Date methods are deprecated? Note: This project will always run with Java 7

    Read the article

  • Change the Default Date setting in Word 2010

    - by Chris
    I am using Word 2010 and Windows 7. You know how when you start typing a date in Word it will automatically suggest what it thinks you want? Like if I start typing “6/29”, a little grey bubble will display “6/29/13 (Press ENTER to Insert)”. How do I get it so the bubble will display the year in a 4 digit format, such as "6/29/2013 (Press Enter to Insert)"? The below picture is how it looks when typing a date into Word. I have already gone to the Date & Time option under the Insert menu and the date format that I want is already selected. I think this is only for using quickparts anyway, so the date automatically updates when you open a document. The Region and Language settings under the Control Panel are correct as well. I thought at one point I found it somewhere under options, but I am sure I looked through everything many times and I can’t find it. I posted this exact question at the Microsoft website and someone replied: Go to the Windows Control Panel and click on Clock, Language and Region and then on Change the date, time, or number format and then modify the Short date format so that it is what you want to be used. So please don't suggest this again, because in my question I did say that I already tried this and it doesn't work, at least not for Word, in this situation. Thanks.

    Read the article

  • created modified function (default) is not working in Cakephp 1.2 version

    - by Jpsworld
    I created an application and all the db tables have 'created,modified' fields that filled automatically by Cakephp's Default Functionality. And i put the Field Type is created datetime NULL, modified datetime NULL, like. But it doesn't work. The data where shows 0000-00-00 00:00:00 Format. The cakephp version is 1.2 , so i put the datetime NULL option ,also i removed the temp,cache files in Model. I need to save the correct date & time format for those 2 fields. If there is any problem with XAMPP version (I use the latest version of XAMPP,1.7.7 PHP: 5.3.8 & mysql v 5.5.16 ) I hope that all are identifies my Issue. Please help me with correct solution. Thanks & Regards, Jpsworld.

    Read the article

  • ASP.NET – Function to Fill Month, Date and Year into Dropdown lists

    - by SAMIR BHOGAYTA
    public void fillMonthList(DropDownList ddlList) { ddlList.Items.Add(new ListItem("Month", "Month")); ddlList.SelectedIndex = 0; DateTime month = Convert.ToDateTime("1/1/2000"); for (int intLoop = 0; intLoop { DateTime NextMont = month.AddMonths(intLoop); //ddlList.Items.Add(new ListItem(NextMont.ToString("MMMM"), NextMont.Month.ToString())); ddlList.Items.Add(new ListItem(NextMont.ToString("MMMM"), NextMont.ToString("MMMM"))); } } public void fillDayList(DropDownList ddlList) { ddlList.Items.Add(new ListItem("Day", "Day")); ddlList.SelectedIndex = 0; int totalDays = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month); for (int intLoop = 1; intLoop { ddlList.Items.Add(new ListItem(intLoop.ToString(), intLoop.ToString())); } } public void fillYearList(DropDownList ddlList) { ddlList.Items.Add(new ListItem("Year", "Year")); ddlList.SelectedIndex = 0; int intYearName = 1900; for (int intLoop = intYearName; intLoop { ddlList.Items.Add(new ListItem(intLoop.ToString(), intLoop.ToString())); } }

    Read the article

  • JQuery UI Datepicker date format issue with initial value

    - by Mithun
    I need to set the initial date for the date picker to 03/20/2010 in mm-dd-yyyyy format. I have done this <input id='datepicker' type='text' value='20/03/2010' /> But my problem is on clicking the field date picker populates with today's date as highlighed and no date selected, and up on selecting date value But when i change my input field like one below <input id='datepicker' type='text' value='03/20/2010' /> Date picker is populating March 20 as selected date and current date highlighted. But all in 'mm-dd-yyyy' format! I want show all dates in 'dd-mm-yyyy' format. How can I solve this?

    Read the article

  • HQL make query searching by date (Java+NetBeans)

    - by Zloy Smiertniy
    Hi all I have the following issue. I have a table of reserves in my MySQL DB, the date columns is defined DATETIME. I need to make a query using hibernate to find all reserves in one day no matter the hour, just that its the same year month and date, and I'm doing this public List<Reserve> bringAllResByDate(Date date){ em = emf.createEntityManager(); Query q = em.createQuery("SELECT r FROM Reserve r WHERE r.date=:date "); q.setParameter("date", date); ... I really dont know how to make it compare, and bring me just those from the specified date, any help??

    Read the article

  • Given a date range how to calculate the number of weekends partially or wholly within that range?

    - by andybak
    Given a date range how to calculate the number of weekends partially or wholly within that range? (A few definitions as requested: take 'weekend' to mean Saturday and Sunday. The date range is inclusive i.e. the end date is part of the range 'wholly or partially' means that any part of the weekend falling within the date range means the whole weekend is counted.) To simplify I imagine you only actually need to know the duration and what day of the week the initial day is... I darn well now it's going to involve doing integer division by 7 and some logic to add 1 depending on the remainder but I can't quite work out what... extra points for answers in Python ;-) Edit Here's my final code. Weekends are Friday and Saturday (as we are counting nights stayed) and days are 0-indexed starting from Monday. I used onebyone's algorithm and Tom's code layout. Thanks a lot folks. def calc_weekends(start_day, duration): days_until_weekend = [5, 4, 3, 2, 1, 1, 6] adjusted_duration = duration - days_until_weekend[start_day] if adjusted_duration < 0: weekends = 0 else: weekends = (adjusted_duration/7)+1 if start_day == 5 and duration % 7 == 0: #Saturday to Saturday is an exception weekends += 1 return weekends if __name__ == "__main__": days = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] for start_day in range(0,7): for duration in range(1,16): print "%s to %s (%s days): %s weekends" % (days[start_day], days[(start_day+duration) % 7], duration, calc_weekends(start_day, duration)) print

    Read the article

  • JQuery Validation [migrated]

    - by user41354
    Im trying to get my form to validate...so basically its working, but a little bit too well, I have two text boxes, one is a start date, the other an end date in the format of mm/dd/yyyy if the start date is greater than the end date...there is an error if the end date is less than the start date...there is an error if the start date is less than today's date...there is an error The only thing is when I correct the error, the error warning is still there...here is my code: dates.change(function () { var testDate = $(this).val(); var otherDate = dates.not(this).val(); var now = new Date(); now.setHours(0, 0, 0, 0); // Pass Dates if (testDate != '' && new Date(testDate) < now) { addError($(this)); $('.flightDateError').text('* Dates cannot be earlier than today.'); isValid = false; return; } // Required Text if ($(this).hasClass("FromCal") && testDate == '') { addError($(this)); $('.flightDateError').text('* Required'); isValid = false; return; } // Validate Date if (!isValidDate(testDate)) { // $(this).addClass('validation_error_input'); addError($(this)); $('.flightDateError').text('* Invalid Date'); isValid = false; return; } else { // $(this).removeClass('validation_error_input'); removeError($(this)); if (!dates.not(this).hasClass('validation_error_input')) $('.flightDateError').text(' '); } // Validate Date Ranges if ($(this).val() != '' && dates.not(this).val != '') { if ($(this).hasClass("FromCal")) { if (new Date(testDate) > new Date(otherDate)) { addError($(this)); $('.flightDateError').text('* Start date must be earlier than end date.'); isValid = false; return; } } else{ if (new Date(testDate) < new Date(otherDate)) { addError($(this)); $('.flightDateError').text('* End date must be later than start date.'); return; } } } }); The main Issue is this part, I believe // Validate Date Ranges if ($(this).val() != '' && dates.not(this).val != '') { if ($(this).hasClass("FromCal")) { if (new Date(testDate) > new Date(otherDate)) { addError($(this)); $('.flightDateError').text('* Start date must be earlier than end date.'); isValid = false; return; } } else{ if (new Date(testDate) < new Date(otherDate)) { addError($(this)); $('.flightDateError').text('* End date must be later than start date.'); return; } } } testDate is the start date otherDate is the end date Thanks in advanced, J

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >