[solved] Changing date but not time

Hello,
I already searched the web but all examples how to change date involved changing time as well.
date -s "7 April 2008 20:42:45"
date -s "7 April 2008 20:42:45"
I need a script that does the follow.
1. Save the current date
2. Change the date to a defined one (but not the time because that conflicts with NTP)
3. Start a program
4. Wait for the program to be closed to restore the original date saved in 1.
How would you write such a script in Bash without changing the time?
Last edited by orschiro (2013-04-07 21:22:52)

Thanks for your replies. I did not know that time and date are inevitably connected to each other and that changing date does always mean changing time as well.
@Trilby,
I indeed want to circumvent a trial-period. I am working on a Linux compatibility version of Prezi Desktop which is no longer provided in an official version. Many people contacted me with issues they are facing that I cannot testify as I do not have a 'Pro' account for which one has to pay. I generally pay for software but in this special case I do not want to pay for an account realising that in fact I cannot use the software due to compatibility issues.
As such, I already tried libfaketime but I failed to get it working with Adobe AIR 32bit on my 64bit system. I am aware that I am doing something that I ought not to do but I am not willed to pay for broken software.
@moetunes
[orschiro@thinkpad ~]$ date -s '7 April 2008'
date: cannot set date: Operation not permitted
Mo 7. Apr 00:00:00 CEST 2008
You see, date -s would reset the time to 00:00 which is not what I was looking for. I want to save my current time to restore it again after closing the program.

Similar Messages

  • When downloading/uploading any file with Firefox, Finder shows date but not time

    On my iMac, as I either upload or download a file using Firefox after installing Lion, the Finder window that opens for me to tell it where to either download the file to or upload it from, shows dates of all the existing docs there, but not the time. How can I make it show the time as well?

    I have found the problem.
    A download manager had been installed for a specific website and it was butting in all the time. Even after removing it with 'Add or remove software' it still had its hooks into the system and it was impossible to download anything as it now would not run.
    Had to do an XP 'System restore' before I could get rid of it.
    The offending program was MD_setup.exe size 3,045KB from the themediadownloader.com

  • Forms field returning date but not time

    Hello everyone, I currently have a field in my database to store a certain date and time. However the corresponding field in my forms builder only seems to display the date and not the time. Does anyone have any idea why this is occuring?
    Thank you.

    also check if you have set a format mask. if so, make sure that time format is included.

  • Changing date but saving time

    I have some code where I copy records from one partition to another partition the table has the
    followin partition.
    PARTITION BY RANGE (CREATE_DATE)
    I would like to change the date to a new value for the destination record but keep the time.
    Here is my code, can somebody provide an example of how I can do this
    CREATE OR REPLACE PROCEDURE C0HARPA.mtas_req_feat_copy_part
    (p_create_date in DATE, p_create_date1 in DATE)
    IS
    --  desc mtas.mtas_req_feat;
    -- REQUEST_SEQ  NUMBER                           NOT NULL,
    -- MTAS_SYSTEM  VARCHAR2(15 BYTE)                NOT NULL,
    -- FEATURE      VARCHAR2(64 BYTE)                NOT NULL,
    -- FLAG         VARCHAR2(16 BYTE),
    -- CREATE_DATE  DATE
    TYPE myarray IS TABLE OF mtas.mtas_req_feat%ROWTYPE;
    l_data myarray;
    myREQUEST_SEQ mtas.mtas_req_feat.request_seq%TYPE;
    CURSOR r IS
    SELECT * FROM mtas.mtas_req_feat r
    WHERE r.create_date >= p_create_date
    AND r.create_date < p_create_date + interval '1' day;
    l_start number default dbms_utility.get_time;
    rows_processed number :=0;
    BEGIN
      -- To prevent ORA-20000: ORU-10027: buffer overflow, limit of 2000 bytes
      DBMS_OUTPUT.ENABLE (buffer_size => NULL);
      select max(REQUEST_SEQ) into myREQUEST_SEQ from mtas.mtas_req_feat;
      DBMS_OUTPUT.PUT_LINE('High Value REQUEST_SEQ is '||myREQUEST_SEQ);
      OPEN r;
      LOOP
        FETCH r BULK COLLECT INTO l_data LIMIT 10000;
        FOR j IN 1 .. l_data.COUNT
        LOOP
          l_data(j).create_date := p_create_date1 || (NEED TIME FROM SOURCE RECORD);
          myREQUEST_SEQ := myREQUEST_SEQ +1;
          l_data(j).request_seq := myREQUEST_SEQ;
          INSERT INTO c0harpa.mtas_req_feat VALUES l_data(j);
          rows_processed := rows_processed+1;
        END LOOP;
        FORALL i IN 1..l_data.COUNT
          INSERT INTO c0harpa.mtas_req_feat VALUES l_data(i);
        COMMIT;
        EXIT WHEN r%NOTFOUND;
      END LOOP;
      COMMIT;
      dbms_output.put_line
         (round((dbms_utility.get_time-l_start)/100, 2) ||' Seconds...' || rows_processed || ' Rows Processed' );
      CLOSE r;
    END mtas_req_feat_copy_part;
    I am calling like this:
    sqlplus / <<EOT >> $LOG 2>&1
    set serveroutput on
    SET PAGESIZE 0
    SET FEEDBACK OFF
    SET VERIFY OFF;
    set heading off;
    set line 200
    exec C0HARPA.mtas_request_copy_part ( to_date( '2011-09-01', 'YYYY-MM-DD' ),
                                                               to_date( '2011-09-02', 'YYYY-MM-DD' ))
    exit;
    EOTThanks to all who answer

    840386 wrote:
    I have some code where I copy records from one partition to another partition the table has the
    followin partition.
    PARTITION BY RANGE (CREATE_DATE)
    I would like to change the date to a new value for the destination record but keep the time.
    Here is my code, can somebody provide an example of how I can do this
    CREATE OR REPLACE PROCEDURE C0HARPA.mtas_req_feat_copy_part
    (p_create_date in DATE, p_create_date1 in DATE)
    IS
    --  desc mtas.mtas_req_feat;
    -- REQUEST_SEQ  NUMBER                           NOT NULL,
    -- MTAS_SYSTEM  VARCHAR2(15 BYTE)                NOT NULL,
    -- FEATURE      VARCHAR2(64 BYTE)                NOT NULL,
    -- FLAG         VARCHAR2(16 BYTE),
    -- CREATE_DATE  DATE
    TYPE myarray IS TABLE OF mtas.mtas_req_feat%ROWTYPE;
    l_data myarray;
    myREQUEST_SEQ mtas.mtas_req_feat.request_seq%TYPE;
    CURSOR r IS
    SELECT * FROM mtas.mtas_req_feat r
    WHERE r.create_date >= p_create_date
    AND r.create_date < p_create_date + interval '1' day;
    l_start number default dbms_utility.get_time;
    rows_processed number :=0;
    BEGIN
    -- To prevent ORA-20000: ORU-10027: buffer overflow, limit of 2000 bytes
    DBMS_OUTPUT.ENABLE (buffer_size => NULL);
    select max(REQUEST_SEQ) into myREQUEST_SEQ from mtas.mtas_req_feat;
    DBMS_OUTPUT.PUT_LINE('High Value REQUEST_SEQ is '||myREQUEST_SEQ);
    OPEN r;
    LOOP
    FETCH r BULK COLLECT INTO l_data LIMIT 10000;
    FOR j IN 1 .. l_data.COUNT
    LOOP
    l_data(j).create_date := p_create_date1 || (NEED TIME FROM SOURCE RECORD);
    myREQUEST_SEQ := myREQUEST_SEQ +1;
    l_data(j).request_seq := myREQUEST_SEQ;
    INSERT INTO c0harpa.mtas_req_feat VALUES l_data(j);
    rows_processed := rows_processed+1;
    END LOOP;
    FORALL i IN 1..l_data.COUNT
    INSERT INTO c0harpa.mtas_req_feat VALUES l_data(i);
    COMMIT;
    EXIT WHEN r%NOTFOUND;
    END LOOP;
    COMMIT;
    dbms_output.put_line
    (round((dbms_utility.get_time-l_start)/100, 2) ||' Seconds...' || rows_processed || ' Rows Processed' );
    CLOSE r;
    END mtas_req_feat_copy_part;
    I am calling like this:
    sqlplus / <<EOT >> $LOG 2>&1
    set serveroutput on
    SET PAGESIZE 0
    SET FEEDBACK OFF
    SET VERIFY OFF;
    set heading off;
    set line 200
    exec C0HARPA.mtas_request_copy_part ( to_date( '2011-09-01', 'YYYY-MM-DD' ),
    to_date( '2011-09-02', 'YYYY-MM-DD' ))
    exit;
    EOTThanks to all who answersince we don't have your tables or data, we can't run or improve posted code.
    to_date( '2011-09-02', 'YYYY-MM-DD' ))time component for DATE above will be all zeros (00:00:00)

  • Editing date but not time

    I am trying to alter the date on a batch of photos but leave the time taken the same. Using batch change won't allow me to achieve desired results

    Do not use batch change - use adjust date and time - just above batch change
    LN

  • Can photos have date, but not time?

    Though I've got a digital camera, in many ways I still prefer the "real" camera - however, I've now taken to getting all the films I have developed scanned & would like to merge them into relevant events.
    I can generally work out the date that something happened; but less sure about the time! I'm taking it, though, that it has to have the time in there somewhere?

    No - just use the data and a standard arbitrary time for unknown time - like midnight for example - or midnight for night photos and noon for daylight photos
    LN

  • Changing fps but not time

    OK, i have to do a project that has to be done SOON, so the
    faster the response, the better.
    Is there any way for me to make the fps larger but keep the
    time the same? e.g.: a 30 second clip at 10 fps, but changing it to
    30 fps while still maintaining 30 seconds

    not that easily, you can change your fps whenever you want
    but then you need to move all the keyframes as well.

  • HT1918 I updated my payment method because I changed my Internet MasterCard of the same number but  new expiry date but not accepted , can you help me

    Please I need help regarding this problem I faced today.
    I updated my payment method because I changed my Internet MasterCard of the same number but  new expiry date but not accepted , can you help me?

    Is the iPhone jailbroken or was jailbroken?. In the article " http://support.apple.com/kb/TS3694 " it says:
    Errors related to downgrading iOS
    The required resource can't be found: This alert message occurs when your device has a newer version of iOS than what is available in iTunes. When troubleshooting a device that presents this alert message, go toSettings > General > About and check the version of iOS on the device. If it's newer than the latest released iOS version, the device may have a prerelease developer version of iOS installed. Installing an older version of iOS over a newer version isn't supported.
    Error 1015: This error is typically caused by attempts to downgrade the software for an iPhone, iPad, or iPod touch. This can occur when you attempt to restore using an older .ipsw file. Downgrading to a previous version isn't supported. To resolve this issue, attempt to restore with the latest iPhone, iPad, or iPod touch software available from Apple. This error can also occur when an unauthorized modification of the iOS has occurred and you're now trying to restore to an authorized, default state.

  • The last update failed on my window 7 pc, resulting in me having to try it manually download and install, this also failed leaving my I tunes not working, I tried restore back to a safer date, but every time it tried to update it failed. eventually i

    The last update failed on
    my window 7 home prermium pc, resulting in me having to try it manually download and install,
    this also failed leaving my I tunes not working, I tried restore back to a
    safer date, but every time it tried to update it failed. eventually it told me
    to delete and reinstall, this fails due to the apple mobile device service
    failing to start, and asking me if I have sufficient privileges to start system
    service, I have tried all suggestions on iTunes page, ie delete everything to
    do with apple, and start as administrator, nothing works, help please

    I too have tried the latest iTunes (12.1.1.4) in Win7. I did a search for latent drivers as you noted but found none. I am glad it worked for you - I'm still no-joy at this point. I'm able to install AMDS over and over again, without issue - it just doesn't start then iTunes launch fails with Error 7. I have to manually remove it.
    I am able to connect my iPhone via USB cable and access my photo storage on the phone. I am just not able to install iTunes anymore. I have attempted resolution to this issue for almost two months now. Until that time, I was content with what was installed. It was only when the proverbial update box appeared that I attempted to 'update' my iTunes. WHAT A MISTAKE putting blind faith into an Apple request to update. I SUGGEST NOT TO UPDATE YOUR ITUNES IF IT IS RUNNING PROPERLY!
    I realize now, once again I might add, my reliance on software provided by others. It's like anything else, I shouldn't rely on just one method for anything. Time to search for a more pleasant alternative than Apple. Truly, when it worked, it was good at its job, but now that I am wasting time I am looking seriously at upgrading to another type of smartphone and media management software. Way too much trouble for anything as simple as this should be. I wonder, is this a result of another feud with Microsoft?

  • I am trying to download UCbrowser which is fine on my iPhone 5C but unable to download on my iPad2, It shows on cloud but I couldn't download, I tried to change date but still no go, It says "you've already purchased this so this will be downloaded now"

    I am trying to download UCbrowser which is fine on my iPhone 5C but unable to download on my iPad2, It shows on cloud but I couldn't download, I tried to change date but still no go, It says "you've already purchased this so this will be downloaded now" but never downloads

    Close the App Store app, reset your iPad and then try again.
    To close the App Store, drag the app up from the multitasking display. Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the app that you want to close and then swipe "up" on the app preview thumbnail to close it.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Selecting records from multiple dates but specific time

    Hi:
    I've to select records of multiple dates but the time should be 00:00:00 to 06:00:00 (i.e. 12 AM - 6 AM)
    For date part this can be done:
    WHERE
    START_TIME BETWEEN TO_DATE('04-01-2012', 'MM-DD-YYYY') AND TO_DATE('04-05-2012', 'MM-DD-YYYY')
    But how can I fix the time mentioed above.
    Please let me know.
    Thanks/Tanvir

    WHERE
    START_TIME BETWEEN TO_DATE('04-01-2012', 'MM-DD-YYYY') AND TO_DATE('04-05-2012', 'MM-DD-YYYY')
    and start_time - trunc(start_time) between 0 and 6/24start_time - trunc(start_time) will give you the fraction of a day. So 6/24 means 06:00.
    (When you use to_char(trunc(sysdate,'hh'),'hh24') between 0 and 6 you will also retrieve records with start_time 06:01 for example. So this would not meet your requirements as far as I understood.)
    Edited by: hm on 10.04.2012 01:26

  • Is there a way to repeat an activity in the calendar monthly on the same day, i.e., the 2nd Wednesday of each month?  I can repeat on the date but not the day of the month.

    Is there a way to repeat an activity in the calendar monthly on the same day, i.e., the 2nd Wednesday of each month?  ( I can repeat on the date but not the day of the month.)

    Not with the stock calendars app.

  • The message cannot be seen on incoming emails.  I can only view the message if I click on reply.  Also any links attached to email will not open.  I have tried everything to solve the problem but not able to.

    A message cannot be seen on my incoming emails.  I can only view the message if I click on reply.  Also any links attached to email will not open.  I have tried everything to solve the problem but not able to.

    Try closing the Mail app completely and see if it works properly when you re-open the app : from the home screen (i.e. not with the Mail app 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Mail app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    If that doesn't work also do a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • The calendar typeface is so dim, I can barely read it. Name of days and date, but not the items I put in. Apple says they have no fix. Anyone else have this problem? Any solutions?

    The calendar typeface is so dim, I can barely read it. Name of days and date, but not the items I put in. Apple says they have no fix. Anyone else have this problem? Any solutions?

    I agree and I found your post because I did a google search ical typeface dim.
    If I find anything out, I will post back here.

  • Sap treasury flow is due before accrual/deferral key date, but not posted

    Hi,
    I run TBB1 - posted business transactions - all transactions posted
    when i run the tbb4 for product type 51a i got the following error
    sap treasury flow is due before accrual/deferral key date, but not posted
    Please see the image

    Hello, Krishna.
    You haven't posted flow types 1150.
    Please go to your transaction, select "Cash flow" tab, Choose layout "106 Posting view", select flow type 1150 (one from your first screenshot above - use flow type and date) and check "Posting status" field - what's inside (please, provide screenshot)?
    NA T2104
    Short Text
    Flow is due before accrual/deferral key date, but not posted
    Diagnosis
    The corresponding flow is due before the accrual/deferral key date, but has not yet been posted; this may result in the incorrect amount of expenses or revenues being displayed in financial accounting.
    System Response
    The flow is treated by the accrual/deferral function as if were already posted, i.e. the related expenses or revenues are accrued/deferred, where appropriate.
    Procedure
    Post the flow to correct the amounts of expenses or revenues shown in financial accounting.

Maybe you are looking for