Search Results

Search found 12421 results on 497 pages for 'date arithmetic'.

Page 38/497 | < Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >

  • GlassFish Community Event @ JavaOne - Save the date!

    - by alexismp
    The interest for having a GlassFish community event at JavaOne is still very strong both inside Oracle and in the community, so this year again we'll be hosting a get together on the Sunday prior to the main event. If you're in town and attending JavaOne, mark your calendars : Sunday 2nd, October 2011 - 12:30pm-4:30pm in the Moscone This will be an opportunity to discuss the community status (adoption of Java EE 6, GlassFish 3.1.x) and hear about future plans, mainly around Java EE 7 and the related GlassFish release(s). We'd also like to have several participants share their deployment stories as well as some time for an free-form unconference format and some team building activity. Of course, beyond all the content shared in slides, this should really also be a good excuse to meet folks from the community and from the core GlassFish team at Oracle. Here's a post on last year's event. And before anybody asks, we are still exploring the party situation :-)

    Read the article

  • Save the Date: Oracle Partner Day Sweden, January 2013

    - by A&C Redaktion
    Welcome to the new edition of the EMEA Oracle Partner Days for FY13. Staged at locations throughout most of the EMEA countries, these events will deliver to you real Business return on your OPN membership. You will hear the business opportunities coming from the adoption of the entire Oracle stack, the latest products value propositions and related sales strategy and be able to connect directly with Oracle executives and find new business opportunities with other partners in your region. Mark your calender and register today for our first Partner Day in the Nordics region on January 30th in Stockholm, Sweden. Click here for the agenda & registration page (in Swedish). The calendar of all upcoming Partner Days you will find here.

    Read the article

  • ASP.NET MVC2 Model Validation Fails with Non-US Date Format

    - by 81bronco
    I have a small MVC2 app that displays in two cultures: en-US and es-MX. One portion contains a user input for a date that is pre-populated with the current date in the Model. When using en-US, the date field is displayed as MM/dd/yyyy and can be changed using the same format without causing any validation errors. When using es-MX, the date field is displayed as dd/MM/yyyy, but when the date is edited in this format, the server-side validation fails with the message: The value '17/05/1991' is not valid for The Date. One of the first things that jumps out at me about that message is that it is not localized. Both the message itself (which I do not think I can control) and the Display Name of the field (which I can control and is localized in my code). Should be displaying in a localized format. I have tried stepping through the code to see exactly where the validation is failing, but it seems to be happening inside some of the compiled MVC or DataAnnotations code that I cannot see. Application details: IIS6, ASP.NET 3.5 (C#), MVC 2 RTM Sample Model Code: public class TestVieModel{ [LocalizedDisplayNameDisplayName("TheDateDisplayName", NameResourceType=typeof(Resources.Model.TestViewModel))] [Required(ErrorMessageResourceName="TheDateValidationMessageRequired", ErrorMessageResourceType=typeof(Resources.Model.TestViewModel))] [DataType(DataType.Date)] public DateTime TheDate { get; set; } } Sample Controller Action Code: [HttpPost] [ValidateAntiForgeryToken] public ActionResult Save(TestViewModel model) { if(ModelState.IsValid) { // <--- Always is false when using es-MX and a date foramtted as dd/MM/yyyy. // Do other stuff return this.View("Complete", model); } // Validation failed, redisplay the form. return this.View("Enter", model); } Sample View Code: <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<HispanicSweeps.Web.Model.LosMets.EnterViewModel>" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Test</title> </head> <body> <% using (Html.BeginForm()) {%> <%= Html.ValidationSummary(true) %> <fieldset> <legend>Fields</legend> <div class="editor-label"> <%= Html.LabelFor(model => model.DateOfBirth) %> </div> <div class="editor-field"> <%= Html.EditorFor(model => model.DateOfBirth) %> <%= Html.ValidationMessageFor(model => model.DateOfBirth) %> </div> <p><input type="submit" value="Save" /></p> </fieldset> <% } %> </body> </html>

    Read the article

  • Sorting an XML in Java

    - by Java Guy
    Hello I have an XML similiar to below, which needed to be sorted using the date field. <root> <Node1><date></date></Node1> <Node1><date></date></Node1> <Node1> <date></date></Node1> <Node1> <date></date></Node1> <Node2> <date></date></Node2> <Node2> <date></date></Node2> <Node2> <date></date></Node2> <Node2> <date></date> </Node2> </root> I would like to sort the XML based on the date(say asc order), irrespective of whether the date is under Node1 or Node2. Actually in Java code I have two seperate lists, one with Node1 objects and other with Node2 obects. I can sort the list in any order sperately inside java. But I need to have the dates sorted irrespective of the nodes it is apperaing on the XML. What is the best approach to sort this way in Java? Actaully I am using Castor for marshalling the java objects to XML. If you know this can be done with Castor, that will be great!

    Read the article

  • Calculate the year for ending month/day?

    - by Dave Jarvis
    Given: Start Year Start Month & Start Day End Month & End Day What SQL statement results in TRUE if a date lands between the Start and End days? 1st example: Start Date = 11-22 End Date = 01-17 Start Year = 2009 Specific Date = 2010-01-14 TRUE 2nd example: Start Date = 11-22 End Date = 11-16 Start Year = 2009 Specific Date = 2010-11-20 FALSE 3rd example: Start Date = 02-25 End Date = 03-19 Start Year = 2004 Specific Date = 2004-02-29 TRUE I was thinking of using the MySQL functions datediff and sign plus a CASE condition to determine whether the year wraps, but it seems rather expensive. Am looking for a simple, efficient calculation. Update 1 The problem is the end date cannot simply use the year. The year must be increased if the end month/day combination happens before the start date. The start date is easy: Start Date = date( concat_ws( '-', year, Start Month, Start Day ) ) The end date is not so simple. Update 2 Here is what I was thinking about for obtaining the end year: end_year = case sign( diff( date( concat_ws( year, start_month, start_day ) ), date( concat_ws( year, end_month, end_day ) ) ) ) when -1 then Start_Year + 1 else Start_Year end case Then wrap that expression (once syntactically correct) inside of another date, followed by BETWEEN statement. Update 3 To clear up some confusion: there is no end year. The end year must be calculated. Thank you!

    Read the article

  • DateFormat conversion problem in java?

    - by androidbase Praveen
    my input String is : 2010-03-24T17:28:50.000Z output pattern is like: DateFormat formatter1 = new SimpleDateFormat("EEE. MMM. d. yyyy"); i convert this like this: formatter1.format(new Date("2010-03-24T17:28:50.000Z"));//illegalArgumentException here the string "2010-03-24T17:28:50.000Z" ouput should be like this: Thu. Mar. 24. 2010 idea but i get a illegalArgumentException. Dont know why? any idea?? stacktrace message is: 04-08 19:50:28.326: WARN/System.err(306): java.lang.IllegalArgumentException 04-08 19:50:28.345: WARN/System.err(306): at java.util.Date.parse(Date.java:447) 04-08 19:50:28.355: WARN/System.err(306): at java.util.Date.<init>(Date.java:157) 04-08 19:50:28.366: WARN/System.err(306): at com.example.brown.Bru_Tube$SelectDataTask.doInBackground(Bru_Tube.java:222) 04-08 19:50:28.366: WARN/System.err(306): at com.example.brown.Bru_Tube$SelectDataTask.doInBackground(Bru_Tube.java:1) 04-08 19:50:28.405: WARN/System.err(306): at android.os.AsyncTask$2.call(AsyncTask.java:185) 04-08 19:50:28.415: WARN/System.err(306): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 04-08 19:50:28.415: WARN/System.err(306): at java.util.concurrent.FutureTask.run(FutureTask.java:137) 04-08 19:50:28.446: WARN/System.err(306): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068) 04-08 19:50:28.456: WARN/System.err(306): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561) 04-08 19:50:28.466: WARN/System.err(306): at java.lang.Thread.run(Thread.java:1096)

    Read the article

  • Evaluating points in time by months, but without referencing years in Rails

    - by MikeH
    FYI, There is some overlap in the initial description of this question with a question I asked yesterday, but the question is different. My app has users who have seasonal products. When a user selects a product, we allow him to also select the product's season. We accomplish this by letting him select a start date and an end date for each product. We're using date_select to generate two sets of drop-downs: one for the start date and one for the end date. Including years doesn't make sense for our model. So we're using the option: discard_year => true When you use discard_year => true, Rails sets a year in the database, it just doesn't appear in the views. Rails sets all the years to either 0001 or 0002 in our app. Yes, we could make it 2009 and 2010 or any other pair. But the point is that we want the months and days to function independent of a particular year. If we used 2009 and 2010, then those dates would be wrong next year because we don't expect these records to be updated every year. My problem is that we need to dynamically evaluate the availability of products based on their relationship to the current month. For example, assume it's March 15. Regardless of the year, I need a method that can tell me that a product available from October to January is not available right now. If we were using actual years, this would be pretty easy. For example, in the products model, I can do this: def is_available? (season_start.past? && season_end.future?) end I can also evaluate a start_date and an end_date against current_date However, in setup I've described above where we have arbitrary years that only make sense relative to each other, these methods don't work. For example, is_available? would return false for all my products because their end date is in the year 0001 or 0002. What I need is a method just like the ones I used as examples above, except that they evaluate against current_month instead of current_date, and past? and future months instead of years. I have no idea how to do this or whether Rails has any built in functionality that could help. I've gone through all the date and time methods/helpers in the API docs, but I'm not seeing anything equivalent to what I'm describing. Thanks.

    Read the article

  • Why does Safari/Opera not work with this javascript code?

    - by robinjfisher
    Hi, I am working on a calendar that will show bookings. The height of containing the booking is calculated dynamically in proportion to the length of the booking. The following code works perfectly well in Firefox but not in Safari or Opera: function calculateBookingHeight(from, to) { var today = new Date; var end = new Date.UTC(today.getUTCFullYear(),today.getUTCMonth(),today.getUTCDate(),23); var start = new Date.UTC(today.getUTCFullYear(),today.getUTCMonth(),today.getUTCDate(),6); var from = new Date(from); var to = new Date(to); if (from > start && to < end) { var difference = (to - from) / 120000; } else if (from > start && to > end) { var difference = (end - from) / 120000; } else { var difference = 510 } return difference; } In summary, each hour on the calendar is a height of 30px. The second if statement deals with the end of the booking being the following day. If I replace the entire code block with return 510, Safari behaves as expected and sets the height of each booking to 510px so I assume it must be something in this function that is causing the problem. Any help would be appreciated. Thanks Robin

    Read the article

  • Finding days between two dates

    - by Ram
    I need to get all the dates between two dates For example Start date : 04/06/2010 End Date : 10/06/2010 Then, it has to list out 05/06/2010 06/06/2010 07/06/2010 08/06/2010 09/06/2010 Thanks

    Read the article

  • Thread testing for time

    - by DanielFH
    Hi there :) I'm making a thread for my application that's going to do an exit operation at a given time (only hours and minutes, day/month doesn't matter). Is this the right way to do it, and also the right way to test for time? I'm testing for a 24 hour clock by the way, not AM / PM. I'm then in another class going to call this something like new Thread(new ExitThread()).start(); public class ExitThread implements Runnable { @Override public void run() { Date date = new Date(System.currentTimeMillis()); String time = new SimpleDateFormat("HHmmss").format(date); int currentTime = Integer.parseInt(time); int exitTime = 233000; while(true) { try { Thread.sleep(10000); } catch (InterruptedException e) { e.printStackTrace(); } if(currentTime >= exitTime ) { // do exit operation here } } } Thanks. //D

    Read the article

  • Converting string to datetime

    - by duder
    I'm trying to enter a date in a mysql table `ssdate` datetime The function that produces the date can output it in 3 formats: 1276142400000 Thu Jun 10 00:00:00 GMT-0400 2010 Fri Jun 4 2010 I'm wondering which of these would be easiest to convert to this field format? Since I'm trying to save only the date, is there a better option than datetime that would work with one of these output formats?

    Read the article

  • mysql : Recieve data only per months

    - by Tristan
    Hello, few times ago, i asked how to do to display datas per month, i must told a bad explanation because i just figured out that it's not what i want : Here's what I got : $req1 = ... AND v.date > (DATE_SUB(CURDATE(), INTERVAL 2 MONTH)) AND v.date < (DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) $req2= ... AND v.date > (DATE_SUB(CURDATE(), INTERVAL 3 MONTH)) AND v.date < (DATE_SUB(CURDATE(), INTERVAL 2 MONTH)) But the problem, imagine that today you are the 10th june, it's going to calculate ALL the data between the 10 june to the 10 may then the 10 may until the 10 april... But what i want is data : from 1st may to 1 st june, from 1st june to 1st july... do you see what i mean ? thank you ;)

    Read the article

  • How to round current time in teradata and insert into timestamp(6) feilds

    - by user3471254
    I have a table with date fields of timestamp(6) fields . create table test_time ( t1 timestamp(6) format 'mm/dd/yyyy hh:mm:si' , ); I want to insert into this table with current date and time rounded. i.e. say for example if the current date time is 08/07/2014 10:34:56 then the value in the table should be 08/07/2014 10:00:00 . (or) if current data and time is 08/07/2014 10:54:56 then also the value should be 08/07/2014 10:34:56

    Read the article

  • Rails -- Cant set value for date_select in form

    - by ChrisWesAllen
    I'm pulling data from an API where the date data comes in as "2008-02-11 00:00:00 " I would like that data to go into my form within the date_select as a value so I can view it correctly before I add it into my database. The view looks like <%= f.label :start_date %><br /> <%= f.date_select :start_date, :value => " #{@stdate[idx]} " %> The object is actually an array of dates since I'm doing this action several times do thats why the [idx] is there; serving as an index. <%= @stdate[idx] % ends up outputting "2008-02-11 00:00:00 " but the fields for the date_select helper only outputs the current date "2010" "June" "5" in those dropdown date selects fields... Do I need to set the values of the Year, Month, and Date Individually? I have Chronic and tried to parse the object before using it as a value for the date_select and that didnt work either. Any ideas?

    Read the article

  • MySQL Query to find consecutive available times of variable lenth

    - by Armaconn
    I have an events table that has user_id, date ('2013-10-01'), time ('04:15:00'), and status_id; What I am looking to find is a solution similar to http://stackoverflow.com/questions/2665574/find-consecutive-rows-calculate-duration but I need I need two additional components: 1) Take date into consideration, so 10/1/2013 at 11:00 PM - 10/2/2013 at 3:00AM. Feel free to just put in a fake date range (like '2013-10-01' to '2013-10-31') 2) Limit output to only include when there are 4+ consecutive times (each event is 15 minutes and I want it to display minimum blocks of an hour, but would also like to be able to switch this restriction to 1.5 hours or some other duration if possible). SUMMARY - Looking for a query that provides the start and end times for a set of events that have the same user_id, status_id, and are in a continuous series based on date and time. For which I can restrict results based on date range and minimum series duration. So the output should have: user_id, date_start, time_start, date_end, time_end, status_id, duration CREATE TABLE `events` ( `event_id` int(11) NOT NULL auto_increment COMMENT 'ID', `user_id` int(11) NOT NULL, `date` date NOT NULL, `time` time NOT NULL, `status_id` int(11) default NULL, PRIMARY KEY (`event_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1568 ; INSERT INTO `events` VALUES(1, 101, '2013-08-14', '23:00:00', 2); INSERT INTO `events` VALUES(2, 101, '2013-08-14', '23:15:00', 2); INSERT INTO `events` VALUES(3, 101, '2013-08-14', '23:30:00', 2); INSERT INTO `events` VALUES(4, 101, '2013-08-14', '23:45:00', 2); INSERT INTO `events` VALUES(5, 101, '2013-08-15', '00:00:00', 2); INSERT INTO `events` VALUES(6, 101, '2013-08-15', '00:15:00', 1); INSERT INTO `events` VALUES(7, 500, '2013-08-14', '23:45:00', 1); INSERT INTO `events` VALUES(8, 500, '2013-08-15', '00:00:00', 1); INSERT INTO `events` VALUES(9, 500, '2013-08-15', '00:15:00', 2); INSERT INTO `events` VALUES(10, 500, '2013-08-15', '00:30:00', 2); INSERT INTO `events` VALUES(11, 500, '2013-08-15', '00:45:00', 1); Desired output row |user_id | date_start | time_start | date_end | time_end | status_id | duration 1 |101 |'2013-08-14'| '23:00:00' |'2013-08-15'|'00:15:00'| 2 | 5 2 |101 |'2013-08-15'| '00:00:15' |'2013-08-15'|'00:30:00'| 1 | 1 3 |500 |'2013-08-14'| '00:23:45' |'2013-08-15'|'00:15:00'| 1 | 2 4 |500 |'2013-08-15'| '00:00:15' |'2013-08-15'|'00:45:00'| 2 | 2 5 |500 |'2013-08-15'| '00:00:45' |'2013-08-15'|'01:00:00'| 2 | 1 *except that rows 2 and 5 wouldn't appear if duration had to be greater than 30 minutes Thanks for any help that you can provide! And please let me know if there is anything I can further clarify!!

    Read the article

  • Django 1.2: Dates in admin forms don't work with Locales (I10N=True)

    - by equalium
    I have an application in Django 1.2. Language is selectable (I18N and Locale = True) When I select the english lang. in the site, the admin works OK. But when I change to any other language this is what happens with date inputs (spanish example): Correctly, the input accepts the spanish format %d/%m/%Y (Even selecting from the calendar, the date inserts as expected). But when I save the form and load it again, the date shows in the english form: %Y-%m-%d The real problem is that when I load the form to change any other text field and try to save it I get an error telling me to enter a valid date, so I have to write all dates again or change the language in the site to use the admin. I haven't specified anything for DATE_INPUT_FORMATS in settings nor have I overridden forms or models. Surely I am missing something but I can't find it. Can anybody give me a hint?

    Read the article

  • Struggling with how to compare hours with different time zones in Java?

    - by Riki
    Hi! I have 2 date object in the database that represent the company's working hours. I only need the hours but since I have to save date. it appears like this: Date companyWorkStartHour; Date companyWorkEndHour; start hours: 12-12-2001-13:00:00 finish hours: 12-12-2001-18:00:00 I have the timezone of the company and of the user. (my server may be in another timezone). TimeZone userTimeZone; TimeZone companyTimeZone; I need to check if the user's current time (considering his timezone) is within the company working hours (considering the company's time zone). How can I do it? I am struggling for over a week with Java calendar and with no success!

    Read the article

  • Find gap between start and end dates for multiple data ranges with overlaps

    - by sqlint
    Need to find gap between start and end dates more than 20 days for multiple data ranges with overlaps. One Id has multiple start dates and end dates. Following Id 1 has two gaps less that 20 day. It should be considered as one range from 10/01/2012 to 10/30/2014 without any gap. 1 10/01/2012 02/01/2013 1 01/01/2013 01/31/2013 1 02/10/2013 03/31/2013 1 04/15/2013 10/30/2014 Id 2 has a gap more than 20 days between end date 01/30/2013 and start date 05/01/2013. It has to be captured. 2 01/01/2013 01/30/2013 2 05/01/2013 06/30/2014 2 07/01/2013 02/01/2014 Id 3 should be considered as one range from 01/01/2012 to 06/01/2014 without any gap. The gap between end date 02/28/2013 and start date 07/01/2013 should be ignored because range from 01/01/2012 to 01/01/2014 cavers a gap. 3 01/01/2012 01/01/2014 3 01/01/2013 02/28/2013 3 07/01/2013 06/01/2014 The cursor can do it but it works extremely slow and not acceptable. SQL fiddle http://sqlfiddle.com/#!3/27e3f/2/0

    Read the article

  • Object Reference with TimeSpan/DateTime

    - by user1732039
    When creating an appointment i want to send an email out to the patient with details like Time, Date etc. I know the email service i have created works (i have tested it by hardcoding strings into the method with the problem. The Problem is that i am getting Object reference issues with converting the Time and Date to a string. It does create the appointment data in the database correctly (time and date). User_Doctor thisDoc = user_DoctorComboBox.SelectedItem as User_Doctor; User_Patient thisPatient = appointment_Patient_autoComplete.SelectedItem as User_Patient; Appointment App = AppointmentSlots.SelectedItem as Appointment; DateTime date = (DateTime)datePickerAppointment.SelectedDate; TimeSpan timeslot = App.Time; //For Emailing Patients string fullname = thisPatient.PatientName + " " + thisPatient.PatientSurname; string mestime = timeslot.ToString("HH:mm"); string mesdate = date.ToString("MM/dd/yyyy"); string email = thisPatient.aspnet_Users.aspnet_Membership.LoweredEmail; EmailServiceClient em = new EmailServiceClient(); em.createMessageAsync(email, "Upcomming Appointment", fullname, mestime, mesdate, thisDoc.aspnet_Users.UserName, true); The problem occures with the strings mestime and mesdate, as well as with getting the email of the user from the database (again this exists in the db, as a nvar)

    Read the article

  • Way to store dates with missing days/months in mysql (php)

    - by Paul M
    I want to store dates in mysql so I set the table to be of type 'Date', which is fine but mysql requires that the full date is provided YYYY-MM-DD. However some of my data does not include day and some is missing the month. Now I could just use a varchar(10) field, but then its difficult to run date based queries on the data. Is there another date format which is not as strong and would allow me to use ?? or 00 where the day/month is not known?

    Read the article

  • Why does my J2ME DateField not display the correct date?

    - by olly
    I am storing values and date values in a record store. I have my date field set up like this: StartDate = new DateField("Start Date ", DateField.DATE); cal1 = Calendar.getInstance(); cal1.set(Calendar.YEAR, 2009); cal1.set(Calendar.MONTH, 0); cal1.set(Calendar.DAY_OF_MONTH, 1); StartDate.setDate(cal1.getTime()); and I save the date as a string as follows: strStartDate = cal1.get(cal1.DAY_OF_MONTH) + "/" + (cal1.get(cal1.MONTH) + 1) + "/" + cal1.get(cal1.YEAR); String detailsToAdd = strStartDate (I have shortened the code.) Now, I want to be able to edit the date at a future stage. However, I need the code to be able to do this. So far I have: EStartDate = new DateField("Start Date ", DateField.DATE); I had to change the name of the DateField box as this was conflicting with other things. I basically need to be able to show the selected record's date attribute. I currently have the other information displayed. I just need to be able to show the correct date. When I run the program the date field says <date>. Any help will be nice

    Read the article

< Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >