Object.Date times getTimes

I have a problem with the Object Date, the recover data the database, getTimes() in my table I have a column with times, in a data I have 04:00:00 and recover with getTime() and convert in hours I get a result 3 hours, some solution

Use java.util.Calendar
Add 1 month to the day.
Set the day of month to be 1.
Subtract 1 day.
Now you are on the last day of the month you wanted.

Similar Messages

  • Inserting date & time in Word 2008 document

    I'm trying to create simple AppleScript and I'm hoping someone on here can help me.
    I work in Word 2008 for Mac and want to create a script that simply inserts the phrase "Left message(space)" plus the date and time whenever I run the script. I'd also prefer that the phrase be in italics if possible. I use this because I often call people and leave them a message and I like to keep a record of when I call them.
    I found this script online and modified it hoping it would meet my needs:
    tell application "Microsoft Word"
    tell selection
    type text text "Left message "
    create new field text range text object of selection field text {"DATE \\@ \"MM/d/yyyy\""}
    end tell
    end tell
    The result is that when I run the script, I get something like this in my document:
    Left message 6/10/2010
    It's a good start, but there are two problems with this.
    First, I would like to insert both the date AND the time.
    Second, when it inserts the date, it makes it an "update automatically" date that updates to the current time every time I open the document. This obviously doesn't help me keep a record of when I made a call. What I would like is for it to just insert the current date and time without updating automatically.
    Third, if possible, I would also like it to be in italics.
    It would look something like this:
    +Left message 6/10/10 5:29 PM+
    I appreciate any advice people can give.
    Message was edited by: LJH_CMH

    Second, when it inserts the date, it makes it an "update automatically" date that updates to the current time every time I open the document
    Sure, that's because you specifically tell it to. Your script inserts a 'new field' which is analogous to Word's dynamic text objects (date, time, page number, etc.)
    Instead, what you want to do is insert an actual string of characters - sure, to you and I that string of characters might look like a date and time, but to Word it's nothing more than a series of characters.
    For that we can fall back on AppleScript's date features, specifically current date, like:
    tell application "Microsoft Word"
      tell selection
        type text text "Left message " & (current date as text)
      end tell
    end tell
    Note that current date as text returns a rather verbose form of the date. If that's too much for you there are alternate options, such as:
    short date string of (current date) & space & time string of (current date)
    which will look more like: "6/10/10 3:26:50 PM"
    But there is also a myriad of other ways (with seconds, without seconds, 12/24 hr, etc.) depending on what you want.
    Third, if possible, I would also like it to be in italics.
    I'll have to look at that one, unless someone else beats me to it.

  • Type of object from a database date/time column

    Hello everyone,
    I've got a concern regarding the way in which coldfusion is
    treating date/time columns in a database.
    In my opinion when I select a column that is let's say
    timestamp type - the object in a query is CF's date/time object.
    I've checked the query by getMetaData() and it looks like each
    column has its own database type (eq. varchar2, date, etc).
    My concern comes from a fact that I've heard that Coldfusion
    is treating the date-time columns in a database as strings and in
    each case it parses them. So the difference in a locale between a
    database server and a Coldfusion server may result in a wrong
    date/time object.
    Example:
    Locale of database EU: yyyy/mm/dd
    Locale of Coldfusion US: yyyy/dd/mm
    The date like 1st of February 2007 stored in a database would
    look then in Coldfusion like: 2nd of January 2007
    Could someone please confirm which version is valid?

    Johnny852 wrote:
    > In my opinion when I select a column that is let's say
    timestamp type - the
    > object in a query is CF's date/time object. I've checked
    the query by
    > getMetaData() and it looks like each column has its own
    database type (eq.
    > varchar2, date, etc).
    if you already know cf is returning a datetime from a
    datetime in the db, what's
    the question?
    > My concern comes from a fact that I've heard that
    Coldfusion is treating the
    "fact"? unless the datetime is stored as a string, that's not
    a "fact".
    > Example:
    > Locale of database EU: yyyy/mm/dd
    > Locale of Coldfusion US: yyyy/dd/mm
    btw neither of your example "locales" are in fact locales.
    > The date like 1st of February 2007 stored in a database
    would look then in
    > Coldfusion like: 2nd of January 2007
    if you pass a numeric string representation (2/1/2007 for
    instance) of a date to
    cf, it will be interpreted via the cf server's "default"
    local (ie en_US,
    month/day/year) unless you use one of the LS functions like
    LSParseDateTime() &
    specifically set the the locale (like setLocale("th_TH")) or
    make the date
    non-ambiguous (2-feb-2007) or build the date yourself from
    user input using
    createDate() or createDateTime(). you just need to convert
    the user's string
    representation to a valid cf datetime object (or i guess
    force to database to
    follow the user's locale date mask).

  • Can I create objects in Muse, assign them with a date/time and arrange on the page accordingly?

    Hi,
    Looking to get my site to a point where I can add content/posts to my pages daily but have the newest posts/content/objects at the top of the page.
    At the moment I have to rearrange the content everytime.
    It would make sense If I could group my objects, assign them a date/time and arrange them on the page accordingly. Once the page gets full it could then overflow to another page based on the master and so on. Without having to manually create the page and rearrange the contents. But I don't know if this is possible or completely stupid!!
    Any help/advice would be greatly appreciated

    Hi,
    Looking to get my site to a point where I can add content/posts to my pages daily but have the newest posts/content/objects at the top of the page.
    At the moment I have to rearrange the content everytime.
    It would make sense If I could group my objects, assign them a date/time and arrange them on the page accordingly. Once the page gets full it could then overflow to another page based on the master and so on. Without having to manually create the page and rearrange the contents. But I don't know if this is possible or completely stupid!!
    Any help/advice would be greatly appreciated

  • Change the icon displayed beside date/time object?

    Hello,
    does anybody knows if it is possible to change the icon that is displayed beside the date/time object (when you click on it the calendar opens)? My customer stated that it is a bit confusing because it looks like a normal dropdown, not like a calendar.
    Regards, Karin

    Hawker,
    Clarify me whether u want to save this date field to only a single table or two tables.
    Regards,
    Gyan

  • Convert date/time to a value in second

    Hello,
    I want to convert a basic date time variable into a numeric one corresponding to the time (in second) passed since January,1,1970 in order to put it in a SQL statment as a criteria.
    Is someone able to help me ?
    Regards

    If you have an java.util.Date object you can call getTime() method on it. It will return milliseconds. Just divide it on 1000. Here is example code:
    java.util.Date date = new java.util.GregorianCalendar(2001, 7, 6).getTime();
    long seconds = date.getTime() / 1000;
    //Your code
    Best regards, Alex.

  • How to Sort JTable data using Multiple fields (Date, time and string)

    I have to fill the JTable data with some date, time and string values. for example my table data looks like this:
    "1998/12/14","15:14:38","Unicorn1","row1"
    "1998/12/14","15:14:39","Unicorn2","row2"
    "1998/12/14","15:14:40","Unicorn4","row3"
    "1998/12/17","12:14:12","Unicorn4","row6"
    Now the Sorted Table should be in the following way:
    "1998/12/17","12:14:12","Unicorn4","row6"
    "1998/12/14","15:14:40","Unicorn4","row3"
    "1998/12/14","15:14:39","Unicorn2","row2"
    "1998/12/14","15:14:38","Unicorn1","row1"
    ie First Date field should be sorted, if 2 date fields are same then sort based on time. if date and time fields are same then need to be sorted on String field.
    So if any one worked on this please throw some light on how to proceed. I know how to sort based on single column.
    But now i need to sort on multiple columns.So what is code change in the Comparater class.
    Thanks in advance.. This is urgent....

    I think your Schedule objects should implement Comparable. Then you can sort your linked list using the Collections.sort() method without passing in a Comparator.class Schedule(Date date, String class) implements Comparable
      public void compareTo(Object obj)
        Schedule other = (Schedule)obj;
        return date.getTime() - other.getDate().getTime();
    }

  • Problem with date + time

    Hi,
    I have a long time problem.
    I want to insert to my table the result of JXDatepicker + JSpinner (time HH:ss).
    It is work until I am calulate todays link in millisecound.
    please run my exampele to see my problem and I'll be happy if u can help me (cell 0,0).
    if you click in every date exept todays link, u get good result format (yyyy-MM-dd HH:ss:00)
    import java.awt.BorderLayout;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.util.Date;import javax.swing.JButton;import javax.swing.JFormattedTextField;import javax.swing.JFrame;import javax.swing.JPanel;import javax.swing.JScrollPane;import javax.swing.table.DefaultTableModel;import org.jdesktop.swingx.JXTable;public class MyTable extends JFrame implements ActionListener {     private JXTable table;     private QM6JXDatePicker date;     private QM6JSpinner spinner;     private JFormattedTextField TxtfPriority;     public MyTable() {          String[] columnNames = { "Date", "String", "Integer" };          Object[][] data = { { new Date(), "AAA", 11 }, { new Date(), "B", 22 },                    { new Date(), "CCCCCC", 3 }, { new Date(), "D", 4 } };          DefaultTableModel model = new DefaultTableModel(data, columnNames);          table = new JXTable(model);          table.setPreferredScrollableViewportSize(table.getPreferredSize());          JScrollPane scrollPane = new JScrollPane(table);          getContentPane().add(scrollPane);          JButton button = new JButton("Update");          button.addActionListener(this);          getContentPane().add(button, BorderLayout.SOUTH);          getContentPane().add(getPanel(), BorderLayout.NORTH);     }     public JPanel getPanel() {          JPanel panel = new JPanel();          date = new QM6JXDatePicker();          spinner = new QM6JSpinner();          panel.add(date);          panel.add(spinner);          return panel;     }     public void actionPerformed(ActionEvent arg0) {          java.sql.Timestamp newDate = new java.sql.Timestamp(date.getDate()                    .getTime());          long miliSecDate = newDate.getTime();          String s = spinner.getTime();          String[] timeStr = s.split(":");          long miliSecTimeH = Long.parseLong(timeStr[0].trim());          long miliSecTimeS = Long.parseLong(timeStr[1].trim());          long miliSecTime = ((miliSecTimeH * 60 * 60) + (miliSecTimeS * 60)) * 1000;          newDate.setTime(miliSecTime + miliSecDate);          table.setValueAt(newDate, 0, 0);     }     public static void main(String[] args) {          MyTable frame = new MyTable();          frame.setDefaultCloseOperation(EXIT_ON_CLOSE);          frame.pack();          frame.setVisible(true);     }}
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    import javax.swing.JPanel;
    import org.jdesktop.swingx.JXDatePicker;
    import org.jdesktop.swingx.JXHyperlink;
    import org.jdesktop.swingx.calendar.JXMonthView;
    public class QM6JXDatePicker extends JXDatePicker {
         private String[] dateStr = null;
         private DateFormat df;
         private SimpleDateFormat df2;
         private JPanel newLinkPanel;
         private JXMonthView calend;
         public QM6JXDatePicker() {
              df = DateFormat.getDateInstance(DateFormat.LONG);
              df2 = new SimpleDateFormat("dd/MM/yyyy");
              dateStr = new String[] { "dd/MM/yyyy" };
              getJXMonthView();
              LinkPanel();
              setFormats(dateStr);
              setMonthView(calend);
              setLinkPanel(newLinkPanel);
         private void LinkPanel() {
              newLinkPanel = new JPanel(new BorderLayout());
              JXHyperlink todayLink = new JXHyperlink();
              todayLink.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        getEditor().setText(df2.format((new Date())));
                        setDate(new Date());
                        getMonthView().getParent().setVisible(false);
              todayLink.setText("Today: " + df.format(new Date()));
              newLinkPanel.add(todayLink, BorderLayout.CENTER);
         private void getJXMonthView() {
              calend = new JXMonthView();
              calend.setTraversable(true);
              calend.setDayForeground(7, Color.RED);
              calend.setDaysOfTheWeekForeground(Color.BLUE);
              calend.setSelectedBackground(Color.YELLOW);
              calend.setFirstDayOfWeek(Calendar.SUNDAY);
         public JXMonthView getCalend() {
              return calend;
         public void setCalend(JXMonthView calend) {
              this.calend = calend;
    import java.util.Calendar;
    import java.util.Date;
    import javax.swing.JSpinner;
    import javax.swing.SpinnerDateModel;
    public class QM6JSpinner extends JSpinner{
         private JSpinner.DateEditor dateEditor;
         public QM6JSpinner() {
              setModel(new SpinnerDateModel(new Date(),
                        null, null, Calendar.MINUTE));
              dateEditor = new DateEditor(this, "HH:mm");
              setEditor(dateEditor);
         public String getTime() {
              return dateEditor.getTextField().getText();
    }Tanks alot!
    Yael

    The main class here...
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Date;
    import javax.swing.JButton;
    import javax.swing.JFormattedTextField;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.table.DefaultTableModel;
    import org.jdesktop.swingx.JXTable;
    public class MyTable extends JFrame implements ActionListener {
         private JXTable table;
         private QM6JXDatePicker date;
         private QM6JSpinner spinner;
         private JFormattedTextField TxtfPriority;
         public MyTable() {
              String[] columnNames = { "Date", "String", "Integer" };
              Object[][] data = { { new Date(), "AAA", 11 }, { new Date(), "B", 22 },
                        { new Date(), "CCCCCC", 3 }, { new Date(), "D", 4 } };
              DefaultTableModel model = new DefaultTableModel(data, columnNames);
              table = new JXTable(model);
              table.setPreferredScrollableViewportSize(table.getPreferredSize());
              JScrollPane scrollPane = new JScrollPane(table);
              getContentPane().add(scrollPane);
              JButton button = new JButton("Update");
              button.addActionListener(this);
              getContentPane().add(button, BorderLayout.SOUTH);
              getContentPane().add(getPanel(), BorderLayout.NORTH);
         public JPanel getPanel() {
              JPanel panel = new JPanel();
              date = new QM6JXDatePicker();
              spinner = new QM6JSpinner();
              panel.add(date);
              panel.add(spinner);
              return panel;
         public void actionPerformed(ActionEvent arg0) {
              java.sql.Timestamp newDate = new java.sql.Timestamp(date.getDate()
                        .getTime());
              long miliSecDate = newDate.getTime();
              String s = spinner.getTime();
              String[] timeStr = s.split(":");
              long miliSecTimeH = Long.parseLong(timeStr[0].trim());
              long miliSecTimeS = Long.parseLong(timeStr[1].trim());
              long miliSecTime = ((miliSecTimeH * 60 * 60) + (miliSecTimeS * 60)) * 1000;
              newDate.setTime(miliSecTime + miliSecDate);
              table.setValueAt(newDate, 0, 0);
         public static void main(String[] args) {
              MyTable frame = new MyTable();
              frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
              frame.pack();
              frame.setVisible(true);
    }

  • Is the date/time in Milliseconds dependent on the underlying timezone

    Hi,
    A Timestamp is received as an argument to a method. It is meant to be for the Time Zone "America/Los_Angeles".
    The value of the Timestamp is "2001-06-06 10:10:10.1".
    The JVM Time Zone is "America/New_York".
    The output of <Timestamp>.getTime() is
    991836610000
    Then I change the default Time Zone to "America/Los_Angeles" and create a new Timestamp with a value of
    "2001-06-06 10:10:10.1". The same as the above Timestamp.
    The output of <Timestamp>.getTime() is
    991847410000
    If I create a new Timestamp object using the value of 991836610000 milliseconds when the default Time Zone is "America/Los_Angeles", the date/time that is given is
    "2001-06-06 07:10:10.1
    The API for <Date>.getTime() states that "Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.". It doesn't mention that it is dependent on the Time Zone in which the Date object was created. Hence I was assuming that the same value will be returned irrespective of the Time Zone the Date object was created in. However it appears not to be so.
    Is there a way to work with date/time objects without been influenced by the underlying default Time Zone? i.e without having to change the underlying Time Zone when working with objects created in one Time Zone and with a need to be applied to a different Time Zone?
    Thanks
    Harsha

    As malcolm pointed out, the problem is that when you parse the date, a reference timezone must be used. If you don't explicitly specify a reference timezone, the default timezone will be used.
    Is there a way to work with date/time objects without
    been influenced by the underlying default Time Zone?
    i.e without having to change the underlying Time Zone
    when working with objects created in one Time Zone and
    with a need to be applied to a different Time Zone?Make sure you specify which timezone the parsed time is in:
    String localTime = ...;
    TimeZone localTimeZone = ...; // you presumably know this
    DateFormat df = ...; // get a formatter for parsing your date
    df.setTimeZone(localTimeZone);
    Date date = df.parse(localTime);

  • Date/Time Picker Output Help

    In my Flex 3.6 app, I have a set of controls that allow the user to pick the date/time.  The user does this by selecting a date from a DateInput, an hour, minutes and AM/PM through three ComboBox.  I then combine the selections into a string and output in a Label control.
    I now need to compare the date/time selected to a set of date/times that are allowed.  I keep running into the error "1067: Implicit coercion of a value of type String to an unrelated type Date."
    How can I convert my date/time string into a valid date object so I can compare it with other date objects?
    Thanks!
    Lee
    Below is the code:
    DateTimePicker.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                                            layout="absolute"
                                            minWidth="955"
                                            minHeight="600">
              <mx:Script>
                        <![CDATA[
                                  [Bindable]
                                  private var todayDate:Date=new Date();
                                  [Bindable]
                                  private var earliestTime:Date=new Date(todayDate.getTime() + 3 * 60 * 60 * 1000);
                                  [Bindable]
                                  private var latestTime:Date=new Date(todayDate.getTime() + 12 * 60 * 60 * 1000);
                        ]]>
              </mx:Script>
              <!--Data-->
              <mx:XML id="hoursXML"
                                  source="assets/hours.xml"/>
              <mx:XMLListCollection source="{hoursXML.hour}"
                                                                  id="xmllcHours"/>
              <mx:XML id="minutesXML"
                                  source="assets/minutes.xml"/>
              <mx:XMLListCollection source="{minutesXML.minute}"
                                                                  id="xmllcMinutes"/>
              <mx:DateFormatter id="dfd"
                                                        formatString="MM/DD/YYYY"/>
              <mx:Label x="10"
                                    y="10"
                                    text="Date/Time"/>
              <mx:DateField x="82"
                                              y="10"
                                              id="dfExpectedDate"
                                              text="{dfd.format(todayDate)}"
                                              selectableRange="{{rangeStart: this.earliestTime,rangeEnd: this.latestTime}}"
                                              visible="true"
                                              width="100"/>
              <mx:ComboBox x="200"
                                             y="10"
                                             id="cbExpectedHour"
                                             fontWeight="normal"
                                             width="80"
                                             text="Hour"
                                             selectedIndex="-1"
                                             dataProvider="{xmllcHours}">
              </mx:ComboBox>
              <mx:ComboBox x="300"
                                             y="10"
                                             width="80"
                                             id="cbExpectedMinute"
                                             fontWeight="normal"
                                             selectedIndex="-1"
                                             text="Minute"
                                             dataProvider="{xmllcMinutes}">
              </mx:ComboBox>
              <mx:ComboBox x="400"
                                             y="10"
                                             width="80"
                                             id="cbExpectedTimeRange"
                                             fontWeight="normal"
                                             selectedIndex="-1"
                                             text="AM/PM">
                        <mx:ArrayCollection>
                                  <mx:Object label="a.m."
                                                         data="AM"/>
                                  <mx:Object label="p.m."
                                                         data="PM"/>
                        </mx:ArrayCollection>
              </mx:ComboBox>
              <mx:Text x="10"
                                   y="38"
                                   text="{this.dfExpectedDate.text} {this.cbExpectedHour.text}:{this.cbExpectedMinute.text}:00 {this.cbExpectedTimeRange.selectedItem.data}"
                                   id="tExpectedLandingDateTime"
                                   visible="true"/>
    </mx:Application>
    hours.xml
    <?xml version="1.0" encoding="utf-8"?>
    <hours>
              <hour>12</hour>
              <hour>01</hour>
              <hour>02</hour>
              <hour>03</hour>
              <hour>04</hour>
              <hour>05</hour>
              <hour>06</hour>
              <hour>07</hour>
              <hour>08</hour>
              <hour>09</hour>
              <hour>10</hour>
              <hour>11</hour>
    </hours>
    minutes.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <minutes>
              <minute>00</minute>
              <minute>01</minute>
              <minute>02</minute>
              <minute>03</minute>
              <minute>04</minute>
              <minute>05</minute>
              <minute>06</minute>
              <minute>07</minute>
              <minute>08</minute>
              <minute>09</minute>
              <minute>10</minute>
              <minute>11</minute>
              <minute>12</minute>
              <minute>13</minute>
              <minute>14</minute>
              <minute>15</minute>
              <minute>16</minute>
              <minute>17</minute>
              <minute>18</minute>
              <minute>19</minute>
              <minute>20</minute>
              <minute>21</minute>
              <minute>22</minute>
              <minute>23</minute>
              <minute>24</minute>
              <minute>25</minute>
              <minute>26</minute>
              <minute>27</minute>
              <minute>28</minute>
              <minute>29</minute>
              <minute>30</minute>
              <minute>31</minute>
              <minute>32</minute>
              <minute>33</minute>
              <minute>34</minute>
              <minute>35</minute>
              <minute>36</minute>
              <minute>37</minute>
              <minute>38</minute>
              <minute>39</minute>
              <minute>40</minute>
              <minute>41</minute>
              <minute>42</minute>
              <minute>43</minute>
              <minute>44</minute>
              <minute>45</minute>
              <minute>46</minute>
              <minute>47</minute>
              <minute>48</minute>
              <minute>49</minute>
              <minute>50</minute>
              <minute>51</minute>
              <minute>52</minute>
              <minute>53</minute>
              <minute>54</minute>
              <minute>55</minute>
              <minute>56</minute>
              <minute>57</minute>
              <minute>58</minute>
              <minute>59</minute>
    </minutes>

    In my Flex 3.6 app, I have a set of controls that allow the user to pick the date/time.  The user does this by selecting a date from a DateInput, an hour, minutes and AM/PM through three ComboBox.  I then combine the selections into a string and output in a Label control.
    I now need to compare the date/time selected to a set of date/times that are allowed.  I keep running into the error "1067: Implicit coercion of a value of type String to an unrelated type Date."
    How can I convert my date/time string into a valid date object so I can compare it with other date objects?
    Thanks!
    Lee
    Below is the code:
    DateTimePicker.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                                            layout="absolute"
                                            minWidth="955"
                                            minHeight="600">
              <mx:Script>
                        <![CDATA[
                                  [Bindable]
                                  private var todayDate:Date=new Date();
                                  [Bindable]
                                  private var earliestTime:Date=new Date(todayDate.getTime() + 3 * 60 * 60 * 1000);
                                  [Bindable]
                                  private var latestTime:Date=new Date(todayDate.getTime() + 12 * 60 * 60 * 1000);
                        ]]>
              </mx:Script>
              <!--Data-->
              <mx:XML id="hoursXML"
                                  source="assets/hours.xml"/>
              <mx:XMLListCollection source="{hoursXML.hour}"
                                                                  id="xmllcHours"/>
              <mx:XML id="minutesXML"
                                  source="assets/minutes.xml"/>
              <mx:XMLListCollection source="{minutesXML.minute}"
                                                                  id="xmllcMinutes"/>
              <mx:DateFormatter id="dfd"
                                                        formatString="MM/DD/YYYY"/>
              <mx:Label x="10"
                                    y="10"
                                    text="Date/Time"/>
              <mx:DateField x="82"
                                              y="10"
                                              id="dfExpectedDate"
                                              text="{dfd.format(todayDate)}"
                                              selectableRange="{{rangeStart: this.earliestTime,rangeEnd: this.latestTime}}"
                                              visible="true"
                                              width="100"/>
              <mx:ComboBox x="200"
                                             y="10"
                                             id="cbExpectedHour"
                                             fontWeight="normal"
                                             width="80"
                                             text="Hour"
                                             selectedIndex="-1"
                                             dataProvider="{xmllcHours}">
              </mx:ComboBox>
              <mx:ComboBox x="300"
                                             y="10"
                                             width="80"
                                             id="cbExpectedMinute"
                                             fontWeight="normal"
                                             selectedIndex="-1"
                                             text="Minute"
                                             dataProvider="{xmllcMinutes}">
              </mx:ComboBox>
              <mx:ComboBox x="400"
                                             y="10"
                                             width="80"
                                             id="cbExpectedTimeRange"
                                             fontWeight="normal"
                                             selectedIndex="-1"
                                             text="AM/PM">
                        <mx:ArrayCollection>
                                  <mx:Object label="a.m."
                                                         data="AM"/>
                                  <mx:Object label="p.m."
                                                         data="PM"/>
                        </mx:ArrayCollection>
              </mx:ComboBox>
              <mx:Text x="10"
                                   y="38"
                                   text="{this.dfExpectedDate.text} {this.cbExpectedHour.text}:{this.cbExpectedMinute.text}:00 {this.cbExpectedTimeRange.selectedItem.data}"
                                   id="tExpectedLandingDateTime"
                                   visible="true"/>
    </mx:Application>
    hours.xml
    <?xml version="1.0" encoding="utf-8"?>
    <hours>
              <hour>12</hour>
              <hour>01</hour>
              <hour>02</hour>
              <hour>03</hour>
              <hour>04</hour>
              <hour>05</hour>
              <hour>06</hour>
              <hour>07</hour>
              <hour>08</hour>
              <hour>09</hour>
              <hour>10</hour>
              <hour>11</hour>
    </hours>
    minutes.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <minutes>
              <minute>00</minute>
              <minute>01</minute>
              <minute>02</minute>
              <minute>03</minute>
              <minute>04</minute>
              <minute>05</minute>
              <minute>06</minute>
              <minute>07</minute>
              <minute>08</minute>
              <minute>09</minute>
              <minute>10</minute>
              <minute>11</minute>
              <minute>12</minute>
              <minute>13</minute>
              <minute>14</minute>
              <minute>15</minute>
              <minute>16</minute>
              <minute>17</minute>
              <minute>18</minute>
              <minute>19</minute>
              <minute>20</minute>
              <minute>21</minute>
              <minute>22</minute>
              <minute>23</minute>
              <minute>24</minute>
              <minute>25</minute>
              <minute>26</minute>
              <minute>27</minute>
              <minute>28</minute>
              <minute>29</minute>
              <minute>30</minute>
              <minute>31</minute>
              <minute>32</minute>
              <minute>33</minute>
              <minute>34</minute>
              <minute>35</minute>
              <minute>36</minute>
              <minute>37</minute>
              <minute>38</minute>
              <minute>39</minute>
              <minute>40</minute>
              <minute>41</minute>
              <minute>42</minute>
              <minute>43</minute>
              <minute>44</minute>
              <minute>45</minute>
              <minute>46</minute>
              <minute>47</minute>
              <minute>48</minute>
              <minute>49</minute>
              <minute>50</minute>
              <minute>51</minute>
              <minute>52</minute>
              <minute>53</minute>
              <minute>54</minute>
              <minute>55</minute>
              <minute>56</minute>
              <minute>57</minute>
              <minute>58</minute>
              <minute>59</minute>
    </minutes>

  • Problem in storing date & Time value

    How to store the Date & time value in 1 textfield only.In my case i am selectecting The Time from two LOV's (HH & MM),then Date value is selecting from simple i/ptext,
    I want to store the (Date+HH+MM) in the date field.......
    code is....
    public String CalculationM() {
    BindingContainer bindings = getBindings();
    DCIteratorBinding dcIterBinding = (DCIteratorBinding)bindings.get("Timeview1Iterator");
    RowSetIterator row= dcIterBinding.getLovRowSetIterator();
    String i=selectOneChoice5.getValue().toString();
    int index=Integer.parseInt(i);
    int index2=index+1;
    Row r= row.getRowAtRangeIndex(index2);
    String val=r.getAttribute("Hour").toString();
    String i1=selectOneChoice6.getValue().toString();
    // System.out.println("HH index="+index2+" MM index is="+i1);
    int index1=Integer.parseInt(i1);
    int index3=index1+1;
    Row r1=row.getRowAtRangeIndex(index3);
    String val1=r1.getAttribute("Minutes").toString();
    int valint=Integer.parseInt(val);
    String valnew;
    if(valint<=12)
    {  if(valint==12)
    valnew=val+":"+val1+":"+"PM";
    else
    valnew=val+":"+val1+":"+"AM";
    else
    val=String.valueOf((valint-12));
    valnew=val+":"+val1+":"+"PM";
    valnew=val+val1;
    String Dateis= inputText4.getValue().toString();
    String Date1=Dateis+" "+valnew;
    System.out.println("TOTAl Date Is="+Date1);
    try
    { SimpleDateFormat sdf = new SimpleDateFormat("dd:MM:yyyy hh:mm");
    java.util.Date date = sdf.parse(Date1);
    java.sql.Date sqlDate = new java.sql.Date(date.getTime());
    oracle.jbo.domain.Date ojdd = new oracle.jbo.domain.Date(sqlDate);
    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();
    DCBindingContainer binding = (DCBindingContainer) app.getVariableResolver().resolveVariable(context, "bindings");
    binding.findIteratorBinding("AppointDetView1Iterator").getCurrentRow().setAttribute(7,ojdd);
    catch(ParseException e)
    System.out.println("Error is:"+e.toString());
    OperationBinding operationBinding =bindings.getOperationBinding("Commit");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    But i am getting error ....the Time is not storing in Date field bt the Time which we r giving with the Date field is storing.......
    My Date Attribute has Date format as dd-MM-yyyy hh:mm:aa
    If i changed it to dd-MM-yyyy then .... The value "12-3-2008" is not a valid date. Valid example: "29-11-2005 ".this error is getting
    Error
    - Not a date.
    Plz help me in this case ...wil be very thankful for ur help.........

    actually i am inputting the value 12-03-2008 but i am getting tha error which i hav told before....
    plz reply me....
    Message was edited by:
    user553181

  • Get Date +time from Oracle

    hi ,
    i saw that i can take date and time in seperate from the ResultSet .
    how can i take the Time part as well from the date in the DB .
    is there a way to create a new Date with the Time from the DB concatinated to it ?
    doing as follows is apparently wrong ...
    Date taskStartDate = rs.getDate("start_assign");
                   Time taskStartTime = rs.getTime("start_assign");
                   long tt= taskStartTime.getTime();
                   Date taskStartDate = new Date(taskStartDatetmp.getTime()+tt);please advise .

    You could convertjava.sql.Date sqlDate = resultSet.getDate("foo");
    java.util.Date javaDate = new
    java.util.Date(sqlDate.getTime());
    This only works if the driver is ignorant enough to pass through millisecond values containing hours/minutes/seconds to the sql.Date, thus violating the contract of sql.Date.

  • How to return a specific date/time range and last event details, when checking the event log via command prompt

    I am new to scripting (literally started reading/learning scripting a few hours ago), and I am stuck in trying to get my current script/command to filter a specific date range.
    * Note: I am working with Server 2003 and 2008; because of the environment I am in, a lot of scripts (such as Powershell and VBScript) don't work; trying to stick with command line, as it appears to be the only thing that functions correctly in my environment
    I am trying to search the System log in event viewer, for the most recent server reboot. Here is the command that I am currently running:
    ===========================================================
    C:\Windows\System32\cscript C:\Windows\System32\eventquery.vbs /L System /FI "id eq 1074"
    ===========================================================
    When run, the output looks like this:
    ===========================================================
    Microsoft (R) Windows Script Host Version 5.6
    Copyright (C) Microsoft Corporation 1996-2001. All rights reserved
    Listing the events in 'system' log of host 'xxxxxxxxxxxxxxx'
    Type Event
    Date Time    Source
    Information 1074
    12/18/2013 2:48:06 AM    USER32
    Information 1074
    11/20/2013 3:25:04 AM    USER32
    Information 1074
    10/23/2013 2:06:09 AM    USER32
    ===========================================================
    What I would like it to do is only show events that have happened in the last seven days, as well as show the event details if it does find an event that matches the criteria.
    Any help would be greatly appreciated. Thanks!
    Nick

    I would prefer using Powershell , you can use below code 
    function Get-EventViewer
    param(
    [string[]]$ComputerName = $ENV:COMPUTERNAME,[string]$LogName,[int]$eventid
    $Object =@()
    foreach ($Computer in $ComputerName)
    $ApplicationEvents = get-eventlog -logname $LogName -cn $computer -after (Get-Date).AddDays(-7) | ?{$_.eventid -eq "$eventid" }
    foreach ($event in $ApplicationEvents) {
    $Object += New-Object -Type PSObject -Property @{
    ComputerName = $Computer.ToUpper();
    TimeGenerated = $event.TimeGenerated;
    EntryType = $event.EntryType;
    Source = $event.Source;
    Message = $event.Message;
    $column1 = @{expression="ComputerName"; width=12; label="ComputerName"; alignment="left"}
    $column2 = @{expression="TimeGenerated"; width=22; label="TimeGenerated"; alignment="left"}
    $column3 = @{expression="EntryType"; width=10; label="EntryType"; alignment="left"}
    $column4 = @{expression="Source"; width=15; label="Source"; alignment="left"}
    $column5 = @{expression="Message"; width=100; label="Message"; alignment="left"}
    $Object|format-table $column1, $column2, $column3 ,$column4 ,$column5
    $Object.GetEnumerator() | Out-GridView -Title "Event Viewer"
    You can do a function call like
    Get-EventViewer -LogName system -ComputerName "computername" -eventid "2017"

  • Urgent help needed in date & time

    I want to same date & time in one field in a database
    As java.sql.date doesn`t support HH:MM:SS
    how do i save (Date & Time) field in the database

    you can extract the hours, minutes, and seconds from your date object.
    int hours = dateobject.getHours();
    int minutes = dateobject.getMinutes();
    int seconds = dateobject.getSeconds();
    String hhmmss = String.valueOf(hours)+String.valueOf(minutes)+String.valueOf(seconds);

  • Saving date & time in DataBase

    Hi All,
    I want to save Date & Time in Database.
    But only Date is saving in Database but time is not saving in Databse.
    In my entity i am mapping my databse date column as,
    @Column(name = "LAST_UPDATE_DATE")
    @Temporal(TemporalType.DATE)
    private Date lastUpdateDate;
    I have imported java.util pakage in my entity.
    In my java class I am setting date as,
    Class ABC{
    public void sample(){
    Object.setLastUpdateDate(new Date());
    But its saving only date not the time.
    Then How to set the time here in Database.
    Please help.
    Thanks
    Sandip

    To persist both date and time you should use a java.sql.Timestamp or java.util.Calendar along with a TemporalType of TIMESTAMP:
    @Temporal(TemporalType.TIMESTAMP)
    private java.util.Timestamp lastUpdateDate;--Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Unable to install OS on Elitbook 8440p after Disabling Drivelock

    Good Morning. I have two Elitebook 8440p computers and I noticed on two of them. When i disabled drivelock and anti theft and attempted to boot it up the machine stays stuck on "Starting Windows".  I have attempted the following support steps 1. Trie

  • PowerPivot and PowerView Features not showing in o365 E3 Plan & SharePoint Online Plan 2.

    I have o365 E3 Plan. I want to use Power View and PowerPivot features for some reporting purpose but when I go to site collection feature it is not showing me both the features but I can see those features in SharePoint site which is on-premise. I wa

  • About source system parameters.

    when I create a source system in BW for connecting to R/3,what's the meaning of available destination(it provide several options,I think they are logical system and all refer to BW itself).There are 2 logical server targets,BW and R/3,but they are th

  • How to reconfigure the Event Server

    We have 3 servers for Enterprise XI v3.1. Let's call them A, B, and C. There is an Event Server running on server A, but it somehow is referring to server B and does not recognize the file events on A. There is also an Event Server on C, referring to

  • Can't add webmail to iphone 3GS

    I have been trying unsuccessfully to add my work email to my iphone. I am able to access webmail from my iphone using safari. To logon with webmail I go to my company outlook webmail website eg: https:\\mail.mywork.ca Then log on with my username: JS