Parsing a time field with SimpleDateFormat

Our users can not key in a military time, they must key in a time with the ampm designation. We allow a for am, p for pm, m for midnight and n for noon. (Don't ask-I guess they don't understand 12:00pm or 12:00am so they specify 12:00m for midnight and 12:00n for noon.)
I want to use the parse function, with lenient set to false to validate that they keyed a valid date. This works fine when they key a or p behind the date. If they key m or n, it gives an error. I tried using DateFormatSymbols to allow a,p,m or n for the AmPmStrings. This works fine if lenient is set to true. With lenient set to false, it still gives me an invalid date. I guess it is not recognizing my DateFormatSymbol.
Not sure if I am going about this the wrong way or if there is an easier way to validate the time. I just thought the parse would be a cleaner way then to substring out the hours and minutes, then validate that they are valid numbers.
Below is the code I was using. Can anyone explain why this won't work?
DateFormatSymbols symbols = new DateFormatSymbols();
     String[] ampm = new String[4];
     ampm[0] = new String("A");
     ampm[1] = new String("P");
     ampm[2] = new String("M");
     ampm[3] = new String("N");
     symbols.setAmPmStrings(ampm);
     SimpleDateFormat df = new SimpleDateFormat("hhmma", symbols);
df.setLenient(false);
try
parsedTime = df.parse(time.toUpperCase());
return true;
catch (ParseException e)
errorMessages.add("Invalid Date.");
return false;
}

Well, this isn't gonna help you, but-
I can't say unequivocally(sp) that this is the case, but after a bit of poking about, it appears that the DateFormatSymbols.setAmPmStrings method ignores everything but the first two entries in the string. That is, if you use
ampm[0] = new String("M");
ampm[1] = new String("N");
ampm[2] = new String("A");
ampm[3] = new String("P");You will be able to parse M's and N's, but not A's and P's.
Not sure if that helps you, but there you go.
Lee

Similar Messages

  • How to query a datetime field with a datetime offset value

    Hi Experts
    I have a problem where I want to query a date time field with a value with a date time offset, and convert the value to the stored timezone.
    The functionality I am after is that the user enters the value 30/08/2011 22:14:46 -4:00 and the report converts it into the timezone of the stored field and performs the query using the date time filter and the local equivilent of the date time entered.
    Has anyone had experience in date time offsets and OBIEE?
    suggestions appreciated.
    Cheers

    Hi,
    Use below one
    cast the timestampadd (sql_tsi_year, -1, timestampadd (sql_tsi_day, -1, current_timestamp)) to a date and see if it
    drops the current time stamp and makes it 00:00:00
    Thanks
    Deva

  • How to prevent an automatic fill in of the current date into a Date/Time Field

    hi,
    maybe i checked out a strange behaviour of the adobe designer. when i put a "normal" data/time field (with no data pattern, display pattern, etc.) on a form and then change (on the pdf preview tab) to the newly designed date field,i have to stay about 2 minutes on this field not filling it out.
    after these minutes the current date is filled in automatically in the date/time field.
    what can i do preventing that? any hints?
    thanks in advance.
    markus

    I don't have any info on timelines, all I can say is check back in future versions of Acrobat :(
    Chris
    Adobe Enterprise Developer Support

  • A form field (for a client fax number) on my own web site is remembering my email address used to log into the site. The usual clearing of the remembered entry works OK, but evey time I remember the login it automatically populates this one field with my

    The form where this happens contains an email field as well as a password field, so it does have both of the fields that are on the login page. It is used to modify the details of the user of our site and is accessed by the administrators, not the users themselves. To auto fill the fax field (which is named _fax) with my email address is very strange. If I log in as a different admin user then the email address I use to login appears in the field. The password field is also appears on the form and is being populated, presumably with my password. How can Firefox get it wrong and put an entry in a field with a different name, and why that field and not other empty fields on the form?
    == This happened ==
    Every time Firefox opened

    First be sure login and password are OK. Sometimes the address starts wit "http://..." and sometime starts with "ftp://...". Try both normal FTP access and Scure FTP access (SFTP). At the end, contact the site's provider.

  • Adding fields with data type "TIMS" to the BP transaction

    hi all,
      This  is Anil regarding the addition of fields to the BP transaction.
    here my problem is for BP transaction I could not find any BADI or screen exit  to add the fields. Even EEWB tool does not allow us to cretate the fields with data type "TIMS". so could you please suggest any other way to add these fields to BP?
    when I enter the values to the time fields in BP transaction, they must reflect in
    BUT000 table also?
    Regards,
    Anil .

    In the physical layer, Column Properties change the data type to int.
    If still problem exists, In the Business Model, write a case statement like
    case when column1=1 then 1 end
    and apply count aggregation on the new calculated column,add the column to presentation table, use that new calculated column for report.
    - Madan

  • How to compare Date in the TextField or DateTime with Date/Time field?

    Hi All,
    I am facing an issue with respect Date comparinson. I tried to look into entire discussions but failed to get the answer.
    My issue is: I wanted to comparet Date/time field value with Date value which is in TextField.
    The functionality of my form is:
    I have dropdown list which lists the registered customer ids binded to XML Datasource. On selection of the customer id from the dropdown I am displaying customer registration date in the TextField or say Date/Time field as below code in dropdown change event.
    RegistrationDetails.PurchaseEntry.txtRegDate.rawValue = regDataNode.CREATION_DATE.value; (this is TextField control)
    In form I have an Date/Time field in which use will select the date of item purchase. In the validation part I want to make sure that, the purchase date selected in Date/Time field must be greater than the Customer Registraiton Date. I able to compare if the customer selects the date from two different Date/Time fields. But how to compare the dates which one is in Date/Time field and Date is in TextField?
    I have tried using Num2Date and Date2Num with "YYYY-MM-DD"  format to compare but not succeed!
    Can you guys help me in this? Thanks in advance
    Regards.

    Hi,
    Yes, I am able to display the date which I have assigned to the text box. In the message box it show the value as '31/05/2009', since in this format i am assigining the date in the text box.
    Here is the code which I am assigning the value:
    RegistrationDetails.PurchaseEntry.txtRegDate.rawValue = regDataNode.CREATION_DATE.value;
    Do I need to change the format while assigning value in text box?
    You have told that, you have attached your test form, nothing is the reply. Can you repost the file?
    Regards.

  • Time field is filled with "0:00:00" problem

    Dear,
    I have three fields "Actual Hours","Actual Start","Actual End".User can fill "Actual Hours" or "Actual Start","Actual End" and calculate "Actual Hours" by "Actual Start" and "Actual End".
    If the  "Actual Start" field is filled with 0:00:00,  if using the actual end time to minus the actual start time, the result should be 16, but the result is empty. 
    Quick feedback will be appreciated!
    Best regards,
    Hu Hongfeng
    Tags edited by: Michael Appleby

    Dear Jason,
    Thanks for your replay!
    I want to calculate 'Actual Hrs' by 'Time' and 'To' or directly fill the 'Actual Hrs' without 'Time' and 'To' ( that why i use special values)
    Now when the 'Time' is filled with '0:00:00', it may judged none (you didn't fill any value).
    e.g.
    The 'Time' field is filled with '0:00:00' and the 'To' is filled with '8:00:00'. The correctly value of 'Actual Hrs' should be '8', but now can't calculate.
    Best Regards,
    Hu Hongfeng

  • DropdownListBox with TIME field

    I have a dropdown list box which displays a list of valid times, with the value read from the database as the selected value.  This format works fine (ex: '080000'):
               <htmlb:dropdownListBox id = "startTimeBeg"
                                       table = "<%= model->table_time %>"
                                       disabled = "<%= model->disabled %>"
                                       selection = "<%= wa_req_head-time_beg %>"
                                       nameOfKeyColumn = "MILITARY"
                                       nameOfValueColumn = "STANDARD" />
    But when I try to use data binding, it does not show the selected value (defaults to 1st item in list):
                <htmlb:dropdownListBox id = "startTimeBeg"
                                       table = "<%= model->table_time %>"
                                       disabled = "<%= model->disabled %>"
                                       selection = "//model/table_req_head[1].time_beg"
                                       nameOfKeyColumn = "MILITARY"
                                       nameOfValueColumn = "STANDARD" />
    All other fields on the screen (inputfields, textedits, dropdowns for data types other than TIMS) data bind correctly.  I reference time fields from several DB tables, and non of these work correctly when I try to data bind.  Occurs both inside and outside of Iterators. 
    Is there something special about time fields which need to be handled differently from other data types when data binding?  Has anyone else seen this?
    Thanks,
    Lisa

    Raja,
        I think your example is basically what I have:
    class ZCL_TVY_I_TRIPDESTINATION definition.
      public section.
        INTERFACES: IF_HTMLB_TABLEVIEW_ITERATOR.
        METHODS:    constructor IMPORTING
                                value(total_rows) TYPE i
                                value(disabled) TYPE string
                                value(countries) TYPE /Y12/ZMCTRYLIST_TT
                                value(times) TYPE /Y12/ZFTV_TIME_TT.
      protected section.
        DATA: m_row_ref TYPE REF TO FTPT_REQUEST.
        DATA: total_rows TYPE i.
        DATA: disabled TYPE string.
        DATA: countries TYPE /Y12/ZMCTRYLIST_TT.
        DATA: times TYPE /y12/ZFTV_TIME_TT.
    endclass.                
    class ZCL_TVY_I_TRIPDESTINATION implementation.
      method CONSTRUCTOR .
        me->total_rows = total_rows.
        me->disabled = disabled.
        me->countries = countries.
        me->times = times.
      endmethod.
      method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START .
        data: itab_countries TYPE REF TO DATA.
        data: itab_times TYPE REF TO DATA.
        data: bee type ref to cl_bsp_bee_table.
        GET REFERENCE OF countries INTO itab_countries.
        GET REFERENCE OF times INTO itab_times.
        CASE p_column_key.
            WHEN 'COUNTRY'.
              p_replacement_bee = CL_HTMLB_DROPDOWNLISTBOX=>FACTORY(
                                     id = p_cell_id
                                     table = itab_countries
                                     _selection = p_cell_binding
                                     disabled = disabled
                                     nameOfKeyColumn = 'CTRY_CODE'
                                     nameOfValueColumn = 'CTRY_NAME' ).
            WHEN 'TIME'.
              p_replacement_bee = CL_HTMLB_DROPDOWNLISTBOX=>FACTORY(
                                     id = p_cell_id
                                     table = itab_times
                                     _selection = p_cell_binding
                                     disabled = disabled
                                     nameOfKeyColumn = 'MILITARY'
                                     nameOfValueColumn = 'STANDARD' ).
          ENDCASE.
    The Country dropdown list works correctly.  The Time dropdown list does not use my time from the DB as the default time in the list. The table of valid times does get placed into the dropdown list.  It just seems to ignore my selection parameter.  Is there something special about the TIMS data type which is causing a match between the selected value and the table of values not to be found?  The selected value works correctly if I use (but I lose my data binding):
              temp_hold = m_row_ref->TIME.
              p_replacement_bee = CL_HTMLB_DROPDOWNLISTBOX=>FACTORY(
                                     id = p_cell_id
                                     table = itab_times
                                     selection = temp_hold
                                     disabled = disabled
                                     nameOfKeyColumn = 'MILITARY'
                                     nameOfValueColumn = 'STANDARD' ).
    Thanks for your help,
    Lisa

  • Problem with Date/Time field in Adobe LiveCycle

    I am trying to create a form that has a check-in and check-out dates. I want the user to enter those dates and then have the form automatically compute how many nights the user intends on staying.
    I have two fields, CHECKIN and CHECKOUT, set up as text fields. My third field, NIGHTS, has the following script to do the calculation:
    var strStart = CHECKIN.rawValue
    var strEnd = CHECKOUT.rawValue
    if(strStart.length && strEnd.length)
    var dateStart = util.scand("mmm d, yyyy",strStart);
    var dateEnd = util.scand("mmm d, yyyy",strEnd);
    var diff = dateEnd.getTime() - dateStart.getTime();
    var oneDay = 24 * 60 * 60 * 1000;
    var days = Math.floor(diff/oneDay);
    this.rawValue = days;
    else
    this.rawValue = 0;
    NOW...this is fine if the user inputs a four-digit year. If not, it's trouble. SO, what I want to do is change the CHECKIN and CHECKOUT fields to the date/time field so they select the date off the pop-up calendar.
    When I make the changes, I can't get the script to work for the NIGHTS field.
    CAN ANYONE HELP THIS NEWBIE?

    Make sure the format of the date strings provided by the calendar is what you are expecting. Or use the "formattedValue" for the input strings.

  • Need help with Time Field

    Hi everyone,
    I'm new to LiveCycle Designer and so far I'm loving it! I have a question on the time field.
    I want the user to enter a time such as 8pm or 830pm and field to automatically display the time as 8:00 PM or 8:30 PM. I have not been able to achieve this.
    If I use anything in the validation area, then I am forcing the user to enter the time in that format (so 8pm fails). If I don't put anything in the validation area, the system doesn't change the time (and it remains displayed as 8pm).
    What am I doing wrong? Any help would be greatly appreciated!
    Jose

    I figured it out.
    Thanks!

  • Time field - timezone

    Hi developers,
    in my WDJ, I am calling a webservice which, executed from wsnavigator, returns this time value:
    1970-01-01T08:30:47.000Z
    On WDJ table I get: 10.30 both with direct binding and computed field such as:
    DateFormat df = DateFormat.getTimeInstance(DateFormat.MEDIUM, Locale.getDefault());
    return df.format(element.getTimeSent());
    The locale the app is in (both from browser and from webdynpro console) is Italy (GMT +1)
    So I should see 09.30
    Can anyone please help?
    Thanks, regards
    Vincenzo

    Hi,
    i recommend to use TimeZone class of java for conversion.
    Below is the example :
    // Suppose this is a date and time in the EST timezone  
    String value = "2006-11-28 09:45:12";  
    DateFormat df1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");  
    df1.setTimeZone(TimeZone.getTimeZone("EST"));  
    // Parses the value and assumes it represents a date and time in the EST timezone  
    Date d = df1.parse(value);  
    DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");  
    df2.setTimeZone(TimeZone.getTimeZone("GMT-1:00"));  
    // Formats the date in the GMT-1:00 timezone  
    System.out.println(df2.format(d));
    hope it helps.
    Thanks & Regards,
    Aditya metukul

  • Problem with SimpleDateFormat

    Hi all,
    I would like to parse a time (00:00:00) in String format into a Date obj. I am using the following code to achieve it. however, the result come out is not what i expect.
       String fromTimeStr = "00:00:00";
       TimeZone sg = TimeZone.getTimeZone("Asia/Singapore");
       System.out.println("Timezone "+sg);
       SimpleDateFormat DF = new SimpleDateFormat("HH:mm:ss");
       DF.setTimeZone(sg);
       Date time = DF.parse(fromTimeStr);
       System.out.println("DAte time"+ time);the output is as followed:
    Timezone sun.util.calendar.ZoneInfo[id="Asia/Singapore",offset=28800000,dstSavings=0,useDaylight=false,transitions=8,lastRule=null]
    DAte timeThu Jan 01 00:30:00 GMT+08:00 1970
    From what i know, the timezone of Singapore is fallen within the GMT+8 zone; thus the result should be Jan 01 00:00:00 GMT+08:00 1970
    My system timezone is "Kuala Lumpur\Singapore GMT+8".
    Could someone enlighten me what there is 30 minutes extra from the output.
    Thanks

    jnaish wrote:
    This is basically what I'm doing:
    package test;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    public class DateFormatError
         private SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
         private Date dateOfBirth;
         public static void main(String[] args)
              DateFormatError x = new DateFormatError();
              x.run();
         public void run()
              String dob = "10/06/1989";
              try
                   dateOfBirth = sdf.parse(dob);
              catch (Exception e)
              sdf.format(dateOfBirth);
              System.out.println(dateOfBirth.toString());
    }Edited by: jnaish on Feb 4, 2009 12:07 PMHey jnaish, thanks for the SSCCE, but your problem is probably already resolved after phdk's post. Just a small side note: never "swallow exceptions". Never ever! To "swallow an exception" is this:
    try {
      // something that may throw an exception
    } catch(AnException e) {
      // do nothing with it: ie, swallow it
    }because whenever something goes wrong, you will not notice it since nothing is even printed to the screen: this makes debugging your code very hard! Always at least print the stack trace:
    try {
      // something that may throw an exception
    } catch(AnException e) {
      e.printStackTrace();
    }so you will see some helpful message on your screen when something goes wrong.
    Good luck!

  • Parsing the Time

    Hello everyone
    Iam trying to parse a string to a SimpleDateFormat and then again to simply display the time. The incoming date is in the format "yyyyMMddHHmmss", the first section of the code <string2Date> converts the string into an eligible standard java date format and this works fine, the second half <string2Time> I'm having a bit of problem with. I wanted to parse the date further and display the time only "HHmmss", the obstacles I've come across is
    HHmmss is not the same length and form as the input yyyyMMddHHmmss
    Casting a Date to a String
    Can anyone help? Please note I'm using jdk1.1
    import java.text.*;
    import java.util.*;
    import java.text.DateFormat;
    import java.io.*;
    import java.lang.Integer;
    public class TimeConvertor extends SimpleDateFormat
              protected Date theDate;     
              protected Date d;
              protected Date theTime;
    public Date string2date(String DateString){     
              String tf="yyyyMMddHHmmss";
              SimpleDateFormat df = new SimpleDateFormat (tf);
              try{
              theDate=df.parse(DateString);
              catch (Exception ex) {
              System.out.println("error in time conv");
         return theDate;
    public Date string2time (String DateString){
              DateFormat tf = new SimpleDateFormat ("yyyyMMddHHmmss");
              DateFormat tdf = new SimpleDateFormat ("hh:mm:ss");
              try
                   d = tf.parse (DateString);
         /*<theTime> wants to parse a string and it wants it the same length as <tf>
         *so this line <df> is an attempt to convert <d> into a string and look only
         at the time of the string/
                   String df=(String)toString(d(Integer.parseInt.substring(8,14)));
                   theTime = tdf.parse (df);
              catch (ParseException e)
                   System.out.println ("Problem parsing hour value");
                   System.out.println (e);
                   e.printStackTrace ();
              System.out.println ("Output = " + theTime);
              return theTime;
    }

    Thanks I followed your advice... i'm getting closer- it compiles and runs but it has a "-depreciator" warning. I wanted to plot a graph: measurements versus time. Having the option of displaying day, week or month plot. The day plot would just display the times associated with that day, then a week with date+time etc. I'd still want the time associated with the date, parsing would be purely for display purposes. Using the Calendar is the best solution, Thanks! My last questions {see comments on code below} are why am i getting this "-dep" warning & can i get rid of it; also how can i display hour:minutes:seconds with out getting the error ")"?
    Thanks again
    import java.text.*;
    import java.util.*;
    import java.text.DateFormat;
    import java.io.*;
    import java.lang.Integer;
    import java.lang.String;
    public class TimeConvertor extends SimpleDateFormat
              protected Date theDate;     
              protected Date d;
              protected Date theTime;
              String tf="yyyyMMddHHmmss";
              SimpleDateFormat df = new SimpleDateFormat (tf);
             Calendar c = Calendar.getInstance();
    public Date string2date(String DateString){     
              try{
                   theDate=df.parse(DateString);
              catch (Exception ex) {
                    System.out.println("error in time conv");
               return theDate;
    public Date string2time (Date theDate){
                      c.setTime(theDate);
                      /*theDate.getMinutes(),theDate.getHours(),etc causes the -dep warning*/   
                  c.set(Calendar.HOUR, theDate.getHours());
                  c.set(Calendar.MINUTE,theDate.getMinutes());  
                  c.set(Calendar.SECOND,theDate.getSeconds());
        /*Error ')' expected*/          
         System.out.println("Time = " c.get(Calendar.HOUR)":" c.get(Calendar.MINUTE) ":" c.get(Calendar.SECOND)); 
         /* This works fine prints out the right hour, minutes, sec but Individually i wanted HH:mm:ss*/     
         System.out.println(c.get(Calendar.HOUR));
         System.out.println(c.get(Calendar.MINUTE));
         System.out.println(+c.get(Calendar.SECOND));
         return c.getTime();
    }

  • Using TIME MACHINE with a TIME CAPSULE

    There's often a bit of confusion about this terminology: +*Time Machine+* vs. +*Time Capsule:+*
    _*Time Machine*_ is Apple software that performs backups, to an external HD, a Time Capsule, etc.; and also allows you to browse and restore from them. It comes with Leopard and Snow Leopard, but cannot run on any previous versions of OSX.
    A _*Time Capsule*_ is a piece of Apple hardware that combines a wireless router and hard drive, that can be used for Time Machine backups and/or other data.
    Most Time Machine questions & problems are not unique to Time Capsules. For those, or if you don't find what you need here, try one of these:
    Time Machine - Frequently Asked Questions
    Time Machine - Troubleshooting
    They can also be found in the *User Contributed Tips* section of both +Time Machine+ forums:
    Mac OS X v10.5 Leopard > Time Machine
    Mac OS X v10.6 Snow Leopard > Time Machine
    Contents
    |
    QUESTIONS
    *Q1. How do I set up Time Machine to back up to my Time Capsule?*
    *Q2. How do I set up Time Machine to back up to a USB drive connected to my Time Capsule?*
    *Q3. Can I use my Time Capsule for Time Machine backups AND other data?*
    *Q4. My Time Capsule is too small to back-up my Mac(s). Now what?*
    *Q5. Should I delete backups? If so, how?*
    *Q6. How do I back-up my Time Capsule and/or USB drive(s) connected to it?*
    If you don't see your question here, try the Frequently Asked Questions *User Tip,* also at the top of the +Time Machine+ forum.
    |
    PROBLEMS
    *P1. The Backup disk image could not be created.*
    *P2. Time Machine could not complete the backup . . sparsebundle could not be accessed. (Error 109).*
    If you don't see your problem here, try the Time Machine - Troubleshooting *User Tip,* also at the top of the +Time Machine+ forum.
    QUESTIONS
    |
    _*Q1. How do I set up Time Machine to back up to my Time Capsule?*_
    |
    First, set up your Time Capsule via +Airport Utility.+ Keep the name you assign to it, your Computer, and your network short (under 25 characters), and avoid embedded spaces, special characters, and punctuation (see item #P1 below for details). Make sure your Mac can connect via an Ethernet cable, if at all possible, as well as wirelessly.
    The setup and first backup (of your entire system) will be much faster if you connect via Ethernet.
    |
    a. If the +Time Machine+ icon isn't already in your Dock, drag it there from your Applications folder. See below for more about it's use.
    b. Right-click it and select +Open Time Machine Preferences,+ click the +Show Time Machine status in the menu bar+ box (see below), then click +Select Disk+ (on Leopard, this button will be either +Choose Backup Disk+ or +Change Disk).+
    c. A list of possible destinations will appear. It should include your Time Capsule (with the name you gave it via Airport Utility), and may show other internal or external drives as well. Select your Time Capsule and click the +Use for Backup+ button.
    d. A prompt for your name and password will appear. In some cases there won't be a Name field, but if there is, enter your short user name. Also enter the password you set up for the Time Capsule via Airport Utility, then click the Connect button.
    e. A 120-second countdown to the start of your first backup will appear in the +Next Backup+ area of the TM Preference panel.
    |
    Note that this first backup will copy the entire contents of your system, except for a few things that are skipped automatically, such as system work files, most caches, your logs, trash, etc., and anything else you may have excluded (see #10 and #11 in the Frequently Asked Questions *User Tip,* also at the top of the +Time Machine+ forum). So it will be rather lengthy, depending on how much data is on your system, whether you're connected via Ethernet or WIFI, and if WIFI, how good the signal is.
    You can continue to use your Mac while TM is backing-up, and you can even cancel a backup if necessary, but to make this first full backup as fast as possible, try not to overload your Mac or cancel the backup.
    |
    _*The Time Machine Icons in your Menubar and/or Dock*_
    |
    In the steps above, you dragged the TM Application's icon into your Dock, and clicked the +Show Time Machine status in the menu bar+ box.
    For detailed info about them, see question #24 in the Frequently Asked Questions *User Tip,* also at the top of the +Time Machine+ forum.
    +Go to Top+
    _*Q2. How do I set up Time Machine to back up to a USB drive connected to my Time Capsule?*_
    |
    Mostly the way you set it up to use the Time Capsule's internal HD.
    But first, attach the drive directly to your Mac, and erase and format it per the instructions in #5 of the Frequently Asked Questions *User Tip,* also at the top of the +Time Machine+ forum. Note, however, that it doesn't matter whether you use the +Mac OS Extended (Journaled)+ or +Mac OS Extended (Case-sensitive, journaled)+ Format, since Time Machine will put your backups in a sparse bundle that's case-sensitive. You cannot change that.
    Unlike the Time Capsule's disk, you can partition the USB drive. That's highly recommended if you're going to be putting other data there, so the backups don't completely fill the disk (but be aware that Time Machine cannot back that "other" data up. See question #Q6 below).
    If you're backing-up multiple Macs to the same drive, you can make one partition for each, but it's not as helpful on a network drive, because each Mac's backups will be in a separate sparse bundle. So you can let them share the disk or a partition.
    Also note that if you've been doing backups to an external disk connected directly to your Mac, you cannot continue the same set of backups when you connect it to your Time Capsule. They are stored differently, and Time Machine will put them in a sparse bundle, alongside but *completely separate from* the backups made locally, and the first backup will be a full backup of your entire system.
    Once the USB disk is set up the way you want it, use the setup procedure in question #Q1 above, but in step (c), select the USB drive/partition, not the Time Capsule's internal HD.
    *RAID Sets connected to a Time Capsule:*
    |
    Time Machine will back up to a +Hardware Mirrored RAID set,+ also called +RAID 1,+ (sold that way, with multiple drives in the same enclosure). However, if you partition the +Hardware Mirrored RAID set,+ once you start using it with TIme Machine, you cannot change the sizes later and continue to back up to the same set of backups.
    While you can connect multiple USB drives to a Time Capsule via a USB hub (a powered one is best), Time Machine +*will not+* back up to a +software Mirrored RAID+ set (where you combine the drives into a single volume via Disk Utility).
    +Go to Top+
    _*Q3. Can I use my Time Capsule for Time Machine backups and other data?*_
    |
    You can put other data on your Time Capsule's internal HD, but there are three major considerations:
    Especially for things like photos and videos, access may be too slow for convenient viewing, and worse for editing. So test this a bit before you decide what to put there.
    Time Machine cannot back-up that other data, so you'll need some other method. See question #Q6 below.
    Time Machine will, by design, fill up all the space available to it, so there may be a conflict between the sparse bundle it puts your backups in, and the other data. There is a workaround, to "reserve" some space there, by creating a disk image of the desired size and storing your data there, but it's a bit cumbersome, and two Macs can't share it at the same time.
    An alternative is to connect a USB drive to your Time Capsule. Then you can back up to the TC's disk and use the USB drive for other data, or vice-versa. But note that Time Machine cannot back-up the USB drive while it's connected to the TC (see question #Q6 below).
    If you want to reserve space on the TC's internal disk, here's how:
    |
    a. Start the +Disk Utility+ app (in your Applications/Utilities folder). Click the +New Image+ icon in the toolbar (or select +File > New > Blank Disk Image+ from the menubar). If the little arrow to the right of the "Save As" box points down, click it so it points up.
    b. Give it a name in the "Save as" box. This name will appear on the TC's disk, with ".dmg" appended. (Similar to the way the sparse bundle containing your Time Machine backups appears, with ".sparsebundle" appended).
    c. Click your TC in the sidebar. It may take a few moments for Disk Utility to recognize it, and show it in the center pane.
    d. In that center pane, select the blue Share folder for your +Time Capsule+ (you may need to scroll down, or enlarge the window, to see it). Once selected, you'll see any existing disk images in the right pane.
    e. Give the Image a name. This name will appear on your desktop and/or Finder sidebar when you mount the .dmg by double-clicking it, if you have the +External Disks+ box checked in +Finder > Preferences > General+ or +Finder > Preferences > Sidebar.+
    f. Select the Size for the amount of space you want to reserve, either one of the pre-sets or Custom which allows any size. Avoid taking all the remaining space for the disk image, as Time Machine needs a bit of room to operate. Also note that if very little space is left, it will begin deleting old backups very soon, to make room for new ones.
    g. Select the desired Format, probably the default of +Mac OS Extended (Journaled).+
    h. If you want it encrypted, select the desired type.
    i. Select single partition, either GUID or +Apple Partition Map.+
    j. Select +Read/Write disk image+ for Image Format.
    k. Click the Create button. The larger the image size, the longer this will take.
    |
    When complete, the new disk image will be automatically mounted on your Mac's desktop, ready to receive the files you want to move into it. (When you first open a disk image, there may not be a sidebar and/or toolbar; if so, select +View > Show Toolbar+ from the Finder menubar.)
    To access this disk image from another computer, you must first eject it from this one, since only one can mount it at a time. Otherwise, the other one will see a message that the disk image is "Temporarily unavailable."
    Note that you may be able to change the size of the disk image later, via +Images > Resize+ from the Disk Utility menubar (while the disk image is not mounted or selected in Disk Utility's sidebar).
    +Go to Top+
    _*Q4. My Time Capsule is too small to back-up my Mac(s). Now what?*_
    |
    You can attach a USB drive to your Time Capsule. Then you can back up to the USB drive instead of the Time Capsule's internal HD. If you have multiple Macs, you can back some up to the TC's internal drive, and others to the USB drive.
    If you need even more space, you can connect multiple USB drives via a hub (a powered one is usually best), and back up different Macs to each. What you cannot do, however, is have one Mac's backups continue from the Time Capsule's internal HD to a USB drive connected to it, or have the backups for any one Mac "span" two drives.
    The exception is, you can connect two (or more) drives that are in a +concatenated RAID+ set (sometimes called +RAID 0).+ In that configuration, all the drives in the set are treated as a single volume (see +Concatenated RAID+ in the Help for Disk Utility for details). This configuration may cause some other difficulties; once they're in a RAID set, you cannot connect any drive to your Mac separately -- it's all or none. And if one drive fails, you risk losing everything on all the drives in the set.
    See question #Q2 above for setup instructions for backing-up to the USB drive.
    +Go to Top+
    _*Q5. Should I delete backups? If so, how?*_
    |
    It depends on exactly what you want to do, and why.
    Under normal circumstances, you shouldn't have to delete anything. TM automatically "thins" (deletes) backups every time it does a new backup, on the following schedule:
    "Hourly" backups after 24 hours (except the first of the day, which is a "Daily" backup).
    "Daily" backups after a month (except the first of each week, which is a "Weekly" backup.)
    "Weekly" backups are kept until TM needs the space for new backups; then one or more of the oldest weeklies will be deleted.
    However, TM will never delete the backup copy of anything that was on the disk being backed-up at the time of any remaining backup. So all that's actually deleted are copies of items whose originals were changed or deleted before the next remaining backup.
    But if you do need to delete backups, here's how:
    To delete individual backups, or all backups of selected item(s), see #12 in the Frequently Asked Questions *User Tip,* also at the top of the +Time Machine+ forum.
    To delete everything on the Time Capsule's internal HD, use +*Airport Utility.+* Select +*Base Station > Manual Set-Up+* from the Menubar, then Disks in the tool Bar, then Erase.
    To delete everything on a connected USB drive/partition, you can delete via the Finder, but that may take a very long time. It may be faster to disconnect it from your Time Capsule, connect it directly to your Mac, and use Disk Utility (in your Applications/Utilities folder) to erase the disk/partition.
    To delete all the backups for one Mac, without disturbing anything else on the Time Capsule's internal disk, open the TC via the Finder and delete the sparse bundle associated with that Mac.
    To delete all the backups for one Mac, without disturbing anything else on a connected USB drive, either open the USB drive via the Finder and delete the sparse bundle associated with that Mac, or disconnect the drive from the TC, connect it directly to your Mac, and delete the sparse bundle from there.
    +Go to Top+
    _*Q6. How do I back-up my Time Capsule and/or attached USB drive(s)?*_
    |
    That depends to some extent on what you want to back up, and where it is.
    It's generally not a good idea to try to back-up your Time Machine backups. If there's a problem with them, it will be copied to (and perhaps magnified on) the copy.
    A better solution is probably to use either Time Machine or a different application to make separate, independent backups of your Mac, to a different destination. A portable external hard drive is great for this; you can periodically connect it to your Mac, make a backup, then take it to a secure off-site location, so you're protected against fire, flood, theft, direct lightning strike on your power lines, etc. If you use Time Machine for this, you'll have to use the disk selection process each time you want to switch, via +Time Machine Preferences.+
    Many folks use the CarbonCopyCloner or SuperDuper! apps to make "bootable clones" of their internal HD to an external HD. While these usually don't have "archived" copies of previous versions of things you've changed or deleted, you can boot and run your Mac from them if your internal HD fails. Your Mac may run a bit slower, but it will be usable. Both are easily found via Google.
    Since Time Machine cannot back up your Time Capsule's internal hard drive, or a USB drive connected to it, if you have other data there, you'll need a different method to back up that other data.
    In a pinch, you can disconnect a USB drive from your Time Capsule, attach it to your Mac, and copy or back it up that way.
    |
    There is a procedure that will let you "archive" the TC's internal disk to a USB drive connected to it.
    But it's not quick, since since the data must be read from the TC's internal disk to your Mac, then sent *back through the Time Capsule* to the connected USB drive. And it's "all or nothing" -- you can only use this procedure to copy the entire contents.
    All users will be disconnected from both the internal HD and the connected USB disk (but the network will remain usable).
    Attach a USB drive with at least as much free space as the total amount of data on the TC's internal HD (see #5 in the Frequently Asked Questions *User Tip,* also at the top of the +Time Machine+ forum, for formatting instructions).
    Turn Time Machine "Off" via +Time Machine Preferences.+ Stop all processes that may be accessing the Time Capsule's disk. If possible, connect your Mac to the Time Capsule with an Ethernet cable -- it will still be slow, but faster than WIFI.
    Then follow this Apple procedure: Using AirPort Utility 5.3.1 or later to make a copy of the Time Capsule disk.
    +Go to Top+
    PROBLEMS
    |
    _*P1. The Backup disk image could not be created.*_
    |
    Oddly enough, Time Machine can be rather picky about the way certain things are named.
    Check your +*Computer Name*+ at the top of the System Preferences > Sharing panel.
    It must not be blank; it should not be more than 25 characters long; and you should avoid punctuation, spaces, and special characters.
    After changing it, click the Edit button and make the corresponding change to the +*Local Hostname.+*
    If that doesn't help, apply the same rules to the name of your Time Capsule and Network, via +Airport Utility.+
    +Go to Top+
    _*P2. Time Machine could not complete the backup .. sparsebundle could not be accessed. (Error 109).*_
    |
    The sparsebundle containing your backups is corrupted.
    Try Repairing it, per #A5 in the Time Machine - Troubleshooting *User Tip,* also at the top of the +Time Machine+ forum.
    If the sparsebundle is on your Time Capsule's internal HD, and Disk Utility can't fix it, your only option is to delete it (or erase the TC's disk), and let Time Machine start over. You may be able to prevent this from happening again by changing the names per problem #P1 above.
    If the sparsebundle is on a USB drive connected to your Time Capsule, and Disk Utility can't fix it, it's possible a heavy-duty 3rd-party +Disk Repair+ application, such as +Disk Warrior+ can. (You'll have to connect the drive directly to your Mac.) These are not cheap, and there's no guarantee they can fix it. Be certain whatever you use is compatible with your OS. For Disk Warrior, you need at least version 4.1.1 for Leopard, 4.2 for Snow Leopard.
    +Go to Top+

    This tip is ready for consideration.
    It is an update to the current Tip at: http://discussions.apple.com/thread.jspa?threadID=2296894
    Changes:
    Q1: replaced info about the TM icons with a link to the TM FAQ tip.
    Q2: added info about RAID sets attached to a TC
    Q6: reworded a bit and replaced last paragraph with a link to the Apple article.

  • Time field in alv list

    Hi all ,
    i want to display alv list with time field . if no data exists in that field its showing 00:00:00 , i have to show it blank. if i change time field as type c in my internal table its showing like this 121314, i need to display it 12:13:14 . if no data it should display balnk . can any one help me out to reslove this issue?

    Hi priya,
    do this:
    declare in your itab a field like sy-uzeit.
    as example.
    move sy-uzeit to itab-uzeit.
    In fieldcat do this:
        MOVE  'X'                        TO   WA_FIELDCAT-NO_ZERO.
    Hope it helps.
    regards, Dieter

Maybe you are looking for

  • Why does my MacBook Pro retina running 10.8.2 freeze upon wake?

    This has happened at least twice: upon being awakened, the backlight of my MBP retina is on (the Apple logo is visible, but nothing is displayed on the LCD), the cursor is spinning but won't move, and touching the keyboard keys results in a system be

  • How can i calculate tempsize and logdir size ?

    Hello: I have one database on a primary server and its replica on a replica server. Since one week to now, Mexican Exchange have had a considerable growth on transactions. My database works in line, every night all data is cleaned waiting for new dat

  • Iphone 4s with iso 6.1.3 imessage not working

    my imessage has stopped working

  • How to use SQL*LOADER to read data in |SMITH|ALFRED| format

    the data I need to upload to table using SQL*LOADER is in format as below: |AD |Argentina  | |CN |China       | |US |America            | |GB |England        |so how should I write my control file to read the data into two columns table? I googled an

  • WDResourceNotFoundException

    Hi friends, I'm trying to upload a excel file from client to server machines. In webdynpro, I used two views ( HCFileUploadView, HCFileUploadDataView ) and one customcontroller (FileUploadCustomController). First view contains FileUploadUI element an