Unix Time (mtime)?

I have a command line that finds files in a folder and deletes the ones that are a over a day old. I can't seem to find a way/the write code to change the 1 (full) day into a half day (12) hours (f -mtime +1 -exec rm -rf {} ) = older than a day. Do you need to convert into milliseconds and then figure out what a half day is in milliseconds?

This is my query:-
round(oracle_to_unix(to_date(to_char(TDC_CBRN.ANSWER_DT,'YYMMDDHH24MISS'),'YYMMDDHH24MISS')))
The oracle_to_unix function :-
create or replace FUNCTION oracle_to_unix
in_date IN DATE)
RETURN NUMBER
IS
BEGIN
RETURN (in_date -TO_DATE('19700101','yyyymmdd'))*86400 - TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone),1,3))*3600;
END;
is it because of my sessiontimezone ?. if YES.. how could i change it ?
As your information, I am from Malaysia and below is my sessiontimezone on my server.
-- Asia/Taipei

Similar Messages

  • How to convert a numeric field representing UNIX time to a standard report

    Looking for some help on the creation of a formula that will allow me to convert a numeric string which represent Unix time to a standard date format.
    Sample string value "1199149200", Jan 1 2008, 1 AM

    Hi,
    Use the DateAdd formula convert Unix epoch to normal datetime (Unix epoch = number of seconds that have elapsed since January 1, 1970).
    DateAdd("s", 1199149200, datetime("01/01/1970 00:00:00"))
    Cheers,
    Fritz

  • Convert Epoch (UNIX) time to a readable timestamp

    Post Author: uberwolfe
    CA Forum: Formula
    I am pulling data from a MS SQL 2000 database (for you phone phreaks out there, I am going against the Cisco CallManager CDR database).  The datetime stamp is in there as UNIX time.  I need to convert and split this into two fields, a date field and a time field.  As I have inherited this and don't know a lot about Crystal Reports I am at a loss.  Currently the report I have (that a developer who is no longer with us wrote) has two formula's.  The formulas are as follows: Time:CTime ({vw_OCESelectionDetail.dateTimeConnect}/8640025569) Date:CDate ({vw_OCESelectionDetail.dateTimeConnect}/8640025569) When the time is returned, it looks to be in GMT.  What type of formula would I need to have to convert the time to the correct time within the timezone I am in.  Any help would be appreciated.  

    Post Author: uberwolfe
    CA Forum: Formula
    Gave me an error stating the year needed to be between 1 and 9999.  I modified it as such CTime (({vw_OCESelectionDetail.dateTimeConnect} - 21600) / 86400 + 25569)
    CDate (({vw_OCESelectionDetail.dateTimeConnect} - 21600) / 86400 + 25569)  Running it right now, but it takes a while.  Let's see what happens.  Will post in a bit. 

  • Time required in Unix time stamp format

    Hello ,
    I am new to java as I have recently started working on it.
    My requirement is to get current system date in Unix format which is integer(32 bit value) .Is there any class in java which will allow me to do this operation.
    Regards
    Vijay

    System.currentTimeMillis() returns a long (64bit integer) containing the number of milliseconds since Jan 01 1970. The UNIX time format is the number of seconds since Jan 01 1970, so all you need to do is get the time using System.currentTimeMillis(), divide by 1000, and cast it to an int (32 bit integer).

  • Convert unix time stamp to readable time with daylight saving

    Hello NG,
    I have a table that has a column containing time stamps in the unix time format (seconds since 1970). If I show these times to the user, they should be converted to some readable format. I'm using the following sql code as an example:
    select to_char(
    to_timestamp_tz(
    to_char(
    to_date('01011970','ddmmyyyy') + 1/24/60/60 * 1086508800,
    'YYYY-MM-DD HH24:MI:SS')||' Europe/Warsaw',
    'YYYY-MM-DD HH24:MI:SS TZR'),
    'YYYY-MM-DD HH24:MI:SS TZH:TZM')
    from dual;
    The output I get is the following:
    TO_CHAR(TO_TIMESTAMP_TZ(TO
    2004-06-06 08:00:00 +02:00
    The output is right, but the format I need is the following:
    2004-06-06 10:00:00
    How do I have to alter the statement to get the correct result (add the two hours of the timezone and dst to the time)?
    Any help is appreciated.
    Regards,
    Mario Freimann

    That's the strange thin ... this timezone doesn't exist.
    Running the query I get the error message
    ORA-01882: timezone-region not found
    The results of the statement
    select * from V$TIMEZONE_NAMES;
    for Europe are:
    TZNAME TZABBREV
    Europe/Dublin LMT
    Europe/Dublin DMT
    Europe/Dublin IST
    Europe/Dublin GMT
    Europe/Dublin BST
    Europe/Istanbul LMT
    Europe/Istanbul IMT
    Europe/Istanbul EET
    Europe/Istanbul EEST
    Europe/Istanbul TRST
    Europe/Istanbul TRT
    Europe/Lisbon LMT
    Europe/Lisbon WET
    Europe/Lisbon WEST
    Europe/Lisbon WEMT
    Europe/Lisbon CET
    Europe/Lisbon CEST
    Europe/London LMT
    Europe/London GMT
    Europe/London BST
    Europe/London BDST
    Europe/Moscow LMT
    Europe/Moscow MMT
    Europe/Moscow MST
    Europe/Moscow MDST
    Europe/Moscow S
    Europe/Moscow MSD
    Europe/Moscow MSK
    Europe/Moscow EET
    Europe/Moscow EEST
    Europe/Warsaw LMT
    Europe/Warsaw WMT
    Europe/Warsaw CET
    Europe/Warsaw CEST
    Europe/Warsaw EET
    Possibly something is not right with my installation (Oracle 9.2.0.1.0) ...

  • Unix Time Stamp to Date for display

    Post Author: merph
    CA Forum: Formula
    I need to convert a unix time stamp to a readable date for a report. Does anyone outthere have a good formula for this?
    Thanks
    Merph

    Post Author: V361
    CA Forum: Formula
    If you can pull a couple of unix epoch times from the database, then let's run these formulae against them and see if it brings up the correct date and time separately.  These formula are pulled from another post by UberWolfe.
    ctime(( - 18000) / 86400+25569)
    cdate(( - 18000) / 86400+25569)
    The 18000 is for to convert for timezones for example 18000 is for     -5 GMT.

  • Conversion of Unix time to GMT

    Does anyone know of a way in which I can turn a date in unix time (no. of seconds since 1st Jan 1970) into a standard GMT format?
    Any help would be greatly appreciated.
    Thanks!

    To use GMT time, use TimeZone:
    * UnixTime.java
    * Created on February 16, 2006, 11:20 AM
    * @author Charles Li
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    import java.util.TimeZone;
    public class UnixTime {
        public static void main(String[] args) {
            GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone("GMT+0"));
            long unixTime = 1234567890L; // unix time is second
            long ONE_SECOND = 1000L; // 1 second = 1000 millisecond
            gc.setTimeInMillis(unixTime*ONE_SECOND);
            // 2009/2/13
            System.out.println("Year: " + gc.get(Calendar.YEAR));
            System.out.println("Month: " + (gc.get(Calendar.MONTH)+1));
            System.out.println("Day: " + gc.get(Calendar.DAY_OF_MONTH));
    }

  • Unix time conversion

    hi
    i have unixtime format 1075329297.572 how do i store it in database.that is with what datatype.i tried to store unixtime using date, timestamp but it does not work.
    but with varchar2 it works. but ifi store with varchar2 i cant perform conversion functions.
    i want to convert unix time into yyyy-dd-mm hh-mm-ss format.
    help me out
    thanks in advance

    how to convert julian Date  to timestamp datatype in Oracle

  • Unix time converter

    Does anyone have a good unix time converter class
    I want to convert a unix time to a UTC time in ss:mm:hh dd,mm,yy
    how to do this?

    int i = 1061287200;
    long t = i * 1000L;
    java.util.Date d = new java.util.Date(t);Assumes original time is seconds since some epoch...

  • VI to convert Unix time to standard time?

    hi,
    I am in need of a VI to convert Unix time to Standard time?
    eg: Unix time: 1268845177 in seconds
    Standard time: GMT: Wed, 17 Mar 2010 16:59:37 GMT
                            Your timezone(U.S):
    Wednesday, March 17, 2010 10:59:37 AM
    I have the calculation but not full formula.
    Unix time is in seconds from Jan 1,1970, 00:00:00 UTC, starting at 0 counting forward.
    When 1268845177/86400 = 14685 days.
    86400 = 60*60*24 seconds
    But how to convert the 14685 days and relate to the current date, how it should be done?
    Either the formula or a VI to convert Unix time to standard time will be a help.
    Regards,
    Arvinth

    Timestamps and the PC clock vs. time on the net are different and I'd say somewhat unrelated concepts.
    You are worried about accuracy of the current time.  Timestamps have nothing to do with current time, but are a way of identifying and particular moment in time.
    Yes, the PC clock gets its time from the net assuming the time server settings are all set properly.  Even the correction of the current PC time may not happen exactly when the leap second gets inserted.  It may be some time before the PC resynchronizes with the net time.  The PC doesn't know if the existence of when a leap second will occur.  And neither does the LabVIEW timestamp.
    Here is an example.  According to http://en.wikipedia.org/wiki/Leap_second, a leap second will occur at the end of June 30 of this year UTC.  Since my clock is eastern daylight time at that date, I put together an example for 8pm on June 30  (UTC +4).  You'll see that the 3 values (a second before, the exact time, and a second after) show they are all 1 second apart.  There is no extra second accounted for.  So in real life the time a second after  vs. a second before are actually 3 seconds apart, but LabVIEW only show 2 seconds.  Feel free to play with the attached snippet for different timezones and daylight savings time and all of that.
    I don't think you really have as big of a problem as you are trying to investigate here.  If your timing needs are that critical where you need accuracy of the current time to better than a second, then you shouldn't be looking at LabVIEW timestamps, PC time clock, or internet time at all, but look at a high accuracy timing source perhaps based on a GPS clock.
    Unless you have a particular test planned to run over the expected point of time where a leap second is inserted, then you shouldn't have to worry.  Even if you do have a test run over the leap second, you probably don't need to worry either.  If the test is based on a waveform datatype, then you have a T0 timestamp, and a dT that will keep track of all the individual data points accurately.
    Attachments:
    Example_VI.png ‏20 KB

  • Unix time to MSSQL time

    I'm creating a view whith a column (end_tyd) that has unix time value's that i want to convert to SQL DATETIME 103.
    Select
    FROM_UNIXTIME(end_tyd)
    From myTable
    Msg 195, Level 15, State 10, Line 22
    'FROM_UNIXTIME' is not a recognized built-in function name.
     

    Hi MVP_88,
    As
    FROM_UNIXTIME is a function of MySQL, there's no such a built-in function in SQL server. To convert the that column to DATETIME 103 in SQL server, you can reference the below.
    DECLARE @end_tyd INT;
    SET @end_tyd=1421629632
    SELECT CONVERT(VARCHAR(10),DATEADD(SECOND,@end_tyd,'1970-01-01'), 103) AS DATE
    /* OUTPUT
    DATE
    19/01/2015
    --In your case
    SELECT CONVERT(VARCHAR(10),DATEADD(SECOND,end_tyd,'1970-01-01'), 103) AS DATE FROM yourTable
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Unix time to standard time

    hi,
    i am writing a program to convert Unix time in the normal date. I wrote the
    following program. The Input is not converted properly to the normal date.
    It prints date without any issue but the time is not correct. As per the java docs
    about the date constructor the value should be calculated from
    01/01/1970 00:00:00 but mine one by default shows 01/01/1970 07:30:00
    I don't know from where 07:30 is coming by default.
    Looking forward for the suggestions.
    import java.io.*;
    import java.util.*;
    import java.text.*;
        public class unixTime{
            public static void main ( String [] args ) throws IOException
                int dateinsec = 0;
                   long t =  dateinsec * 1000L; 
                   SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
                   Date regDate = null;
                   regDate = new Date(t);
                   System.out.println("Formatted date is: " + formatter.format(regDate));
        }Thanks.
    Corrected thanks
    Edited by: vinee on Oct 7, 2008 2:10 AM

    vinee wrote:
    Sorry i didn't check earlier that i posted at the wrong place.
    Extremely sorry.No worries. Just don't do it again please.
    In the future, if you do post in the wrong place and want to repost the question in the right place, just go back to your original, and provide a reply that says something like "move to" + the URL of your new thread, so there's one coherent discussion and people don't duplicate each others' efforts.

  • UNIX time to Oracle time

    Hallo,
    I am acquiring the data for my reports in a UNIX evironment using embedded SQL.
    Therefore I am searching for a function that converts the UNIX time to ORACLE time. Currently I am doing the conversion via a string representation but I would prefer a function that does it on a binary level.
    Thanks a lot - Ulrich

    maybe (using the link provided) ;)
    select case when :unixts between -2114380800 and 2145916799
                then TO_DATE('19700101000000','YYYYMMDDHH24MISS') + NUMTODSINTERVAL(:unixts,'SECOND')
           end the_date
      from dualRegards
    Etbin

  • Changing Unix Time Stamp

    Hi everyone,
    Am trying to change the unix time to normal date format. am using *"<?xdoxslt:ora_format_date_offset('1970-01-01', DUE_T div 86400, ??)?>"*+
    But when I try to run the report (with sample xml), it is showing me the below error:
    "Caused by: oracle.xdo.parser.v2.XPathException: Error in expression: 'xdoxslt:ora_format_date_offset('1970-01-01', DUE_T div 86400, ?+?)'.
         at oracle.xdo.parser.v2.XSLProcessor.reportException(XSLProcessor.java:806)
         at oracle.xdo.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:614)
    Can anyone help me on this.
    Thanks in advance,
    Imtiaz.

    Hi,
    Can anyone please help me on this?
    Thanks,
    Imtiaz.

  • Unix time to normal time

    Hi all,
    We have done the data migration of DFM fault History from the database to Crsytal Report 2008. The data migration is also including a column of date and time. Migration process completed and we noticed on crystal report, the date and time format has changed into 13 digits of unix time format (eg: 1254538573296).
    In order to change it to the normal date and time format (eg: mm/dd/yyy 12:34:56 am), we do add a few syntax to the crystal report and we manage to change it. however the problem is, the date and time was appeared wrongly. we
    have tried using online converter and after few times we noticed that,if only 10 digits from the unix time is entered, the date and time may appear correctly. Whereas we have 13 digits of unix time that we obtained from the data migration.
    Is there any way that we can fix this so that there will only take 10 digits from the database instead of 13 digits?

    The 13 digits are seen because DFM is written in Java, and Java stores an extra three digits for milliseconds since January 1, 1970.  There is no way to export a 10 digit epoch time from DFM.  Your post-processing script will need to strip off the trailing three digits to create an epoch time which only includes seconds.

Maybe you are looking for

  • How To Turn 1 iTunes Library into 2 / Split movies/tv shows from music?

    I am trying to find answer how to split iTunes library. I want to move the music,podcasts (and all meta data) from my iMac to my new Macbook Air, but want to leave the Movies & Tv Shows (and all meta data) on the iMac. Any suggestions or links to pre

  • Satelliete No Longer Booting

    Hello: I have a Toshiba Satellite p755-s5215 running Windows 7 Home Premium.  Recently, while attempting to remove malware on the laptop, my antivirus program restarted the computer and it went straight to a black screen with the following message: I

  • F-04 can not select Vendor overdue  open item

    Hi, I'm clearing Vendor open items by F-04 but it can only select out the open items which are not overdue. How I can select out the open items already overdue? Thanks in advance! Flora

  • Updating 'Payee acct no' in table PAYR for 'Check' Payment through F110.

    Hi All,           Automatic Payment is done for vendors with payment method 'C' which is configured under Payment method Classification 'Check'. Here table PAYR is not updating the vendor bank account in field 'Payee acct no'. This field is updated f

  • Recommendations for a bluetooth mouse?

    Hello, I've been looking for a Bluetooth mouse for a few weeks now to go along with my Macbook and after coming on here and reading some of the troubles that come along with them, I was wondering if anyone had any recommendations? I've never used an