Could someone please help me fix my date class?

I'm trying to use a string made from the current day/month/year to create a new directory. It makes a directory, but it appears not to initialize to the current date. Here is the output: /home/rick/testDir/Sunday_March_1 (and it appears in my local directory structure). Today's date is Monday_September_2008. How do I get the correct string?
public void createDir(){
          GregorianCalendar cal = new GregorianCalendar();
          String currentDate = new String();
          cal.setTime(new Date());
          cal.setFirstDayOfWeek(0);
          int day = Calendar.DAY_OF_WEEK;
          int month = Calendar.MONTH;
          int intYear = Calendar.YEAR;
          Integer year = Integer.valueOf(intYear);
          currentDate = "/home/rick/testDir/" + dayToString(day) + '_' + monthToString(month) + '_' + year.toString();
          File f = new File(currentDate);
          f.mkdir();
          System.out.println(currentDate);
     }

Rick_Avlonitis wrote:
I'm trying to use a string made from the current day/month/year to create a new directory. It makes a directory, but it appears not to initialize to the current date. Here is the output: /home/rick/testDir/Sunday_March_1 (and it appears in my local directory structure). Today's date is Monday_September_2008. How do I get the correct string?
public void createDir(){
          GregorianCalendar cal = new GregorianCalendar();
          String currentDate = new String();
          cal.setTime(new Date());
          cal.setFirstDayOfWeek(0);
          int day = Calendar.DAY_OF_WEEK;
          int month = Calendar.MONTH;
          int intYear = Calendar.YEAR;
          Integer year = Integer.valueOf(intYear);
          currentDate = "/home/rick/testDir/" + dayToString(day) + '_' + monthToString(month) + '_' + year.toString();
          File f = new File(currentDate);
          f.mkdir();
          System.out.println(currentDate);
Well, I don't know your day- and monthToString methods...
But remenber that Calendar.DAY_OF_WEEK etc. are static and will always return the same value.
Read [http://java.sun.com/j2se/1.4.2/docs/api/java/util/GregorianCalendar.html]

Similar Messages

  • Could someone please help me fix my Mail Trash?

    I think I did something really stupid. When I'm in my mail, I see a Trash icon, and then below it, two more trash icons. The two lower ones are labeled "On My Mac" and "Jane Smith" (not my real name but the trash icon is labeled with my real name). Thinking it's silly to have so many trash icons, I stupidly deleted the one with my name by it. The icon is still there but if I try to delete anything out of my inbox, I get an error message saying "The destination mailbox “Trash — Jane Smith” does not allow messages to be moved to it." I can only delete by dragging emails over to the "On My Mac" trash icon.
    I'd be very grateful if someone could help me fix this.
    Oh, and my email account is a POP account.
    Thank you.

    Rick_Avlonitis wrote:
    I'm trying to use a string made from the current day/month/year to create a new directory. It makes a directory, but it appears not to initialize to the current date. Here is the output: /home/rick/testDir/Sunday_March_1 (and it appears in my local directory structure). Today's date is Monday_September_2008. How do I get the correct string?
    public void createDir(){
              GregorianCalendar cal = new GregorianCalendar();
              String currentDate = new String();
              cal.setTime(new Date());
              cal.setFirstDayOfWeek(0);
              int day = Calendar.DAY_OF_WEEK;
              int month = Calendar.MONTH;
              int intYear = Calendar.YEAR;
              Integer year = Integer.valueOf(intYear);
              currentDate = "/home/rick/testDir/" + dayToString(day) + '_' + monthToString(month) + '_' + year.toString();
              File f = new File(currentDate);
              f.mkdir();
              System.out.println(currentDate);
    Well, I don't know your day- and monthToString methods...
    But remenber that Calendar.DAY_OF_WEEK etc. are static and will always return the same value.
    Read [http://java.sun.com/j2se/1.4.2/docs/api/java/util/GregorianCalendar.html]

  • Quicktime movie trailers still not playing, could someone please help me?

    I have not been able to watch any movie trailers from quicktime for two years now and this is really getting old.
    my inf!
    computer: DELL
    system: Windows XP SP2
    QT player version: 7.2
    I have all system requirments and updates also allready unselected derctX and selected safe mode, still all I get when loading the movie trailer from QT websight is the white box with QT logo in middle, sometime the logo will also have ?mark over it. I figured it was just taking its own sweet time loading so I wated it out. 4 hours later there was still no change. you'd think apple would have fixed or resolved this problem since it has been ongoing for last two or more years.
    Could someone please help me?????????
    Message was edited by: scarpredelder

    Try https://discussions.apple.com/thread/4890398?start=0&tstart=0
    See if that helps
    Allan

  • HT1766 Hi there, could someone please help me, i didnt have my icloud on before my iphone 4s broke. I have always used iTunes and everything was backed up on there and now im finding it hard to restore my phone with contacts, photos etc.

    Hi there, could someone please help me, i didnt have my icloud on before my iphone 4s broke. I have always used iTunes and everything was backed up on there and now im finding it hard to restore my phone with contacts, photos etc.

        Dear Tylerkeefe,
    Good morning. Getting notifications that you are close to exceeding your allowance can certainly be alarming. It would be my pleasure to help put your mind at ease.
    I understand you are not streaming movies, music, etc. Which these features will use a lot of data. Are you using the Mobile Hotspot on your phone. This may also cause you to exceed your data allowance quickly if you do not power if off after you are done using the feature. To turn off mobile hostpot tap settings>general>personal hotspot>off. Do you have any third party applications that you have installed that may be running a lot of data?
    To ensure applications are not consistently running in the background do the following press the menu button at the bottom of your phone twice. All the open apps will then appear. Select and hold the bottom of the screen. A minus sign will then appear in the top left of each app. Select each minus sign to close out the application.
    I hope the information given will help clarify what is using a lot of data on your phone. Should you have further questions or concerns, please feel free to reach out to us.
    Thank You,
    MichelleS_VZW
    VZW Support
    Follow us on Twitter @VZWSUPPORT

  • My safari keeps closing unexpectedly and when it does it tells me that it quite while using the .GameHouseBeachParty.so plugin. I have no idea what this means! Can someone please help me fix this?

    My safari keeps closing unexpectedly and when it does it tells me that it quite while using the .GameHouseBeachParty.so plugin. I have no idea what this means! Can someone please help me fix this?

    You have the Flashback trojan.
    Check out the replies in this thread for what to do;
    https://discussions.apple.com/message/18114958#18114958

  • My husband and I both have types of IPods but we can not download any music to them because we have an Acer Android tablets. Could someone please help us to be able to download music to our IPods all we have is this tablet

    We have two types of Ipods. A nano generation 5 & a nano touch, and we are unable to download music to them was told its because we have an Acer Android tablet. Could someone please help us in solving this issuses cause we just bought these ipods and was not aware that and all we have is this tablet. .. Please help us

    Templeton Peck, the Android tablet  does not support iTunes
    Angs78, you purchase music from iTunes on the iPod touch. I know of no way to get music on the Nanao from the tablet.

  • My husband and I both have iPhones on the same account. When he did his update yesterday, he chose both his number and my number during set up. Now he is getting my messages, too. Can someone please help me fix this?

    My husband and I both have iPhones on the same account. When he did his update yesterday, he chose both his number and my number during set up. Now he is getting my messages, too. Can someone please help me fix this?

    What do you mean he chose his and your number during setup. Chose them for what? Is you number showing up in the Settings>Messages>"You can be reached by imessage at" section? If it is he needs to remove it.
    Cheers,
    GB

  • Could someone please help me with contact form php.

    Hi,
    could someone please help me wright the php for this contact form?
    <form class="contact_form" action="kontakt.php" method="post">
                <p><input type="text" required="required" id="contact_name" name="contact_name" class="text_input" value="" size="22"  />
                <label for="contact_name">Namn *</label></p>
                <p><input type="text" required="required" id="contact_company" name="contact_company" class="text_input" value="" size="22"  />
                <label for="contact_company">Företag *</label></p>
                <p><input type="email" required="required" id="contact_email" name="contact_email" class="text_input" value="" size="22"  />
                <label for="contact_email">Epost *</label></p>
                <p><textarea required="required" name="contact_content" class="textarea" cols="30" rows="5"></textarea></p>
                <p><button type="submit" class="button white"><span>Skicka</span></button></p>
                <input type="hidden" value="[email protected]" name="contact_to"/>
            </form>
    Its no sence writing down my php as it is useless.
    All help is appriciated.
    Thank you

    Please don't post duplicate threads. Continue the discussion in http://forums.adobe.com/thread/1080721.
    This thread is now locked.

  • Hi, i was wounding if anyone would help me get information on the company regarding the acquisition of, beats by dre, could someone please help me out as i am doing a college report on this and need some good sources of information

    hi, i was wounding if anyone would help me get information on the company regarding the acquisition of, beats by dre, could someone please help me out as i am doing a college report on this and need some good sources of information

    Try a search with Google.
    Why should we do your homework for you?

  • My iPhone 4s refuses to play sound when the headphones are not in. When the headphones are in however, it works perfectly fine! This is most annoying, could someone please help me :)

    My iPhone 4s refuses to play sound when the headphones are not in. When the headphones are in however, it works perfectly fine! This is most annoying, could someone please help me   I have not dropped it and it has not been in any contact with liquid.

    I just tried both of those things and to no avail. Here are some pictures if that will help

  • Could someone please help me, I bought my daughter an iphone 4s for my daughters birthday yesterday and set it up for her so she could use it straight away, now we share emails, facetime and when i download an app she gets it too,

    Could someone please help me, I bought my daughter an iphone 4s for her birthday yesterday and I set it up for her so she could use it straight away, now we share emails, facetime and when i download an app she gets it too, very annoying for us both.

    you can use the same apple id for purchasing apps and music if you want, but turn off automatic downloads. it may be better to have separate ones, but if you want the same app you'd have to pay twice. that's something you'll have to think about. for all the other stuff like facetime and messages and icloud you need to have separate icloud id's. see the apple link below.
    http://support.apple.com/kb/HT4895?viewlocale=en_US&locale=en_US

  • Hi, I need someone to help me change the login screen. The computer I have is a macbook, its second hand and probably around 3-4 years old. The previous owner had the login screen has a lego or something. Could someone please help me change this??

    Hi, I need someone to help me change the login screen. The computer I have is a macbook, its second hand and probably around 3-4 years old. The previous owner had the login screen has a lego or something. Could someone please help me change this??

    computerilliterate52 wrote:
    hi all, i hope someone is very computer litterate about java that is i have a dell 2400 pc windows xp 2, well since msn isnt downloading anymore java updates we all have to download a compatible one to our computer i use explorer and i can play www.iwin.com online games, yet when i go on to the msn browswer it wont load the games all i see is it just trying to load and load nothing said and nothing done. what could be wrong it works on ie and not msn browser? i have zone alarm, i have avg spyware tester and spyblaster, but i thought it may of kept me from downloading all this yet it worked on IE please help and i dont have flash player either it wont seem to work any and i mean any help is welcome.i tried to change the browser settings and did all that stuff i am on broadband DSL and they dont seem to know they say that isnt there job its msn's so i asked them and they said no it is quest broadband since i am with them i just get the run around i have IE 6.0 ihave java plug in 1.4.2. o3 yet it says not verified, i have java 1.6.o o1 i have java plugin 1.6.0 01 i have that twice ? dont know why. and java envirinmemet i have the right stuff cuz like i said it plays or works on explorer not msn browserer bar. i see no picture's in center of the page as it tries to load it is a blank page any help thank you i have been trying going on 3 weeks now thanksI agree with the other posters; try Firefox. It sounds like a bit of a mess and what you may need is an onsite PC tech to do some maintenance on your PC.
    Also, learning to properly use punctuation (particularly periods) might not be a bad idea. As it is, your post was very hard to read.
    Good luck!

  • Could someone please help me with getting the sabnzbd daemon to start?

    Hi everyone,
    I'm a classic newbie.  I managed to follow some instructions I found on the web to get sabnzbd to install (via Yaourt), and when I invoke it from the command line, it works fine.
    I've read that you can get it to start as a daemon, which would be really good.  Could someone please explain how this should be done?
    Where do I need to put the sabnzbd.init file?
    What about the sabnzbd.confd file?
    I'm okay enough with adding sabnzbd to the /etc/rc.conf file, but I can't quite configure it so that the necessary files are in place to start it.
    If you need any details of my setup, please let me know.
    Thanks heaps,
    Luke

    birdie101 wrote:Where would I find a good place to describe how to install programs using PKGBUILDs?  and what that process is actually doing?
    Apart from the wiki article on ABS, always look at the pkgbuild when in doubt. This is also helpful when you want to know what compile arguments are passed to GCC. Custom postinstall commands are run through .install file (example what is displayed after installation), this is generally foo.install in the AUR for a pkg named foo. And most importantly, familiarize yourself with compiling process, and Arch specific routines like a daemon should be defined in /etc/rc.d/, instead of /etc/init.d/ in other linuxes.
    Edit: A best exercise would be to create a pkgbuild yourself. Arch always recommends community contributions.
    Last edited by shemz (2010-09-24 08:08:14)

  • Could someone please help me import my iphoto photos into aperture?  They are now just referenced files.

    Hello,
    I am a longtime iphoto user and installed aperture this past december.  At that time I imported all my iphoto photos as referenced files and kept them in their iphoto location.  Since that time, every photo I took was uploaded directly into aperture and stored there.  I am now comfortable enough with aperture that I would like to use it as my primary photo viewer / manipulator and would like to merge my two libraries into one single aperture library.  Unfortunately, I cannot figure out how to do this. 
    I tried consolidating all originals yesterday, however this did not seem to have any effect.  I then tried reimporting my iphoto library, however, this simply duplicated many of my events (and the duplicated ones were not even adjustable via aperture, and each photo had a little exclamation point in the lower right corner).  Both of these attempts did nothing to combine my aperture projects and my iphoto events (which are now seen as a seperate iphoto tab under projects).  I am aware that I can now switch to my iphoto library within aperture in version 3.3, but I just want everything stored in one place and in my aperture library.  Can someone please help me with this?
    The only thing I can think of is deleting all of the iphoto events from aperture and then reimporting them, but I am scared I will either delete something permenantly or that they will simply reimport as referenced files and remain within iphoto. 
    Please help!
    Thanks,
    - Mike

    Mike,
    I am not quite clear about the current state of your iPhoto and Aperture libraries. It looks like you have plenty of broken links to referenced masters in either library. Whatever you do now, it is very important to ensure that you have a working backup, both of your iPhoto Library and your Aperture library, before you try a major reconstruction.
    I tried consolidating all originals yesterday, however this did not seem to have any effect.
    In what way did it not have any effect? From the effects you are describing, it looks like all your original master images have been removed from the iPhoto Library and are now inside the Aperture library as managed masters - at least, this would explain, why trying to import the iPhoto library resulted in duplicated projects (and the duplicated ones were not even adjustable via aperture, and each photo had a little exclamation point in the lower right corner). You removed the original masters from the iPhoto library, and now you could not import it, since the originals are now in Aperture.
    For me it looks, like you simply need to delete the iPhoto images marked with an exclamation mark, for these are already bound to images that you imported earlier. It is perfectly o.k. that the recently imported iPhoto Library appears in a separate section of the projects in your Library Inspector Panel. Each iPhoto event should appear as a project. Aperture will put them there, so you can find them easily.
    You should check now, if the originally imported images, that you imported as referenced, are now managed. If you enable badge overlays you should see no longer any arrows on the thumbnails of your earlier imports. Also, if you select one of these images, you should be able to toggle between original master and version by typing the "M" key.
    Define some smart albums (File > New > Smart album) based on the file status: Add a rule: File status is.
    One smart album: File Status is referenced
    One smart album: File Status is managed
    One smart album: File Status is missing
    The first album should be empty.
    The second album should show all your images you originally imported from iphoto as managed, and that you recently consolidated.
    The third album should show your recent import - the images imported from iPhoto after you consolidated the originals to Aperture and removed these images from iPhoto.
    Post back, when you have checked the file status of your images in Aperture and we can be sure were the images are exactly.
    Regards
    Léonie

  • I pod disabled because of forgotten password, was never synced with i tunes. belongs to my 7 year old daughter. someone please help me fix it

    please help me fix my 7 yr. old daughters i pod!!she made a password without my knowledge,because thats what big brother does.well needless to say she forgot it and now its disabled before it was synced with i tunes. she only had it a few days!! it was also bought used from game stop. can someone please help!

    Disabled
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up     
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    If you previously synced to the computer then you may be able to recovery use of the iPod without erasing the iPod by following the instructions here:
    Disabled Recovery-must use syncing computer.

Maybe you are looking for

  • *Connection problems Sap A Java Application*

    Hi Gurus, I have a problem. I'm riding the part of the JCO SERVER for SAP from sending information to a Java application. I created the RFC destination of the type TCP / IP and I have registered my JAVA application in the visual administrator. This a

  • Authorization on windows?

    How do i authorize my computer to play purchased things on itunes? the information on it from tech support did not help at all.

  • After installing OS5 my sync is stuck on back up 2 of 7 - 12 hours

    After installing OS5 my ipad is stuck on backing up 2 of 7 - 12+ hours waiting

  • Oracle10g on zLinux

    Hi guys, I have to install Oracle10g Database on IBM zSeries for Linux. Metalink says that Suse SLES8 is certified for IBM zSeries for Linus. Does exist a diferent Linux for zSeries ? Can I install the same Suse Linux for Intel ? zSeries works with l

  • Computer does't recognize ipod

    I got the "sad ipod"-icon, tried the simple restart of the ipod (press the select and menu-button) but nothing happened. So i thought I would install the latest ipod-updater, but my computer doesn't recognize my ipod, it doesn't appear in itunes or i