Convert the XMP Date and time

Hi, in my script I try to read the Date and time using the functions of a file selected in bridge XMP.  So, I want to convert this date and time in a format that looks like: "12/01/10 | 13:23 "and writing, to another field of metadata, like the description.  Im stuck trying to convert the date and time in I want it looks like?  Someone can help, thanks!

Here is the part of the code, with the fact that I have a problem:

When I read the dateTimeOriginal file property, it's in an unfriendly format.  It seems strange and indicates the time zone.  The commented lines is the code that I tried, but didn't work.  I tried to convert the XMPDateTime object in a Date object so I can adjust the format, but I failed.

var myXmpFile = new XMPFile (selectedFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);

var myXmp = myXmpFile.getXMP ();

var Name = myXmp.getProperty (XMPConst.NS_EXIF, "DateTimeOriginal");

var date = new XMPDateTime (new Date ((Name));

date2 var = new Date (date);

dateFormat.masks.portfolioDate = "mm/dd/yy" | "hh: mm TT';"

Date.format ("portfolioDate");

date2.format("mm/dd/yy");

Alert (date2. ToString());

Name.convertToLocalTime ();

Name ();

Alert (Name);

This should be close...

var str = myXmp.getProperty(XMPConst.NS_EXIF, "DateTimeOriginal").toString();
var dat =str.match(/(\d+).(\d+).(\d+).(\d+).(\d+).(\d+)/);
var amOrPm = "AM";
var hours = Number(dat[4]);
if (hours > 11) amOrPm = "PM";
if (hours > 12) hours = hours - 12;
if (hours > 11) amOrPm = "PM";
if(hours <10) hours = '0' + hours;
var dateString = dat[3]+"/"+dat[2]+"/"+dat[1].substr (2) +" | "+ hours +':'+dat[5]+ ' ' +amOrPm;
$.writeln(dateString);

Tags: Bridge

Similar Questions

  • Toshiba Satellite L50 - B of the Bios date and time to reboot

    Hello.
    I have Toshiba Satellite L50 - B for more than a year. I upgraded the RAM to 8 GB and it works fine. But the last 10 days of the BIOS date and time keeps restarting by default whenever I turned off or in hibernation laptop. My battery is dead, but I'm not, it reloads all the time and restart the BIOS after that I have unplug the phone charger. I think that the CMOS battery is dead, but when I open the laptop there is no CMOS battery. Someone told me that this model has a kind of Flash for the time of the bios chip. How can I fix it?

    Get a new battery and will be all good.

  • I can not get the automatic updates on my samsung jack sgh-i616. _ "connection to the update server is not available. Check your data connection settings and make sure that the device date and time are correct "___RESULT CODE: 80072ee7__ _"

    I can't get the automatic updates on my samsung jack sgh-i616.

     

    "Connection to the update server is not available. "Check your data connection settings and make sure that the device date and time are correct.

     

    RESULT CODE: 80072ee7

     

    -It is a windows mobile 6.1

    Thank you very much! = D

    As a guide.

    This error code translates ERROR_INTERNET_CANNOT_CONNECT.

    You may encounter temporary connection related errors when you use Windows Update or Microsoft Update to install updates
    http://support.Microsoft.com/kb/836941

    Harold Horne / TaurArian [MVP] 2005-2011. The information has been provided * being * with no guarantee or warranty.

  • My incoming mail has the wrong date and time on this subject. How can I fix it?

    incoming mail has the wrong date and time when they arrive in my Inbox.

    The timestamp on an e-mail comes from two places, time on the mail server settings and the settings of the time on your PC.  This time setting includes the current time, the time zone and setting time summer time.  If one of them is off, the timestamp will be wrong.  You can check on your PC, but not those on the mail server.


    HAL
    --
    HAL Hostetler, TCE
    Engineer senior/UPDATED--MS MVP-Print/Imaging - WA7BGX
    www.kvoa.com--KVOA TV, Tucson, AZ.
    Concert at the Hot Licks - www.badnewsbluesband.com
  • a patch can change the release date and time table psrelease?

    a patch can change the release date and time table psrelease?

    Thank you.

    What kind of patch? A bundle? A maintenance plan? An upgrade of the application?
    In any case, I'm sure that it does not change any date, but he has a line in this table.

    Nicolas.

  • 2D Array element 1 duplicate an int and the other Date and time for the output to a file

    Try to change the example labview Agilent 34401 acquire and graph - SW Triggered.vi

    to display the data in a file with a date/time stamp, display things in a file delimited by commas, it's very simple in PHP, C, C++, and I heard this thing of labview was great fast tool but I work on this simple mod for 5 hours now and still cannot get this to work.

    I have attached my example updated, but I can't seem to get this thing to convert the date and time to something that can go in the same array as the data...


  • Whenever I turn on my computer I need to the correct date and time

    I have windows XP everytime I turn on, I have to change the date and time, as it shows always 1 January 2005 23.00

    [Moved from comments]

    On Wednesday, April 10, 2013 19:32:35 + 0000, joey2140 wrote:

    I have windows XP everytime I turn on, I have to change the date and time, as it shows always 1 January 2005 23.00

    Certainly, you need to replace the motherboard battery CMOS.
    They are just 3 $US or more and easy to replace.

  • Problem with the registration date and time: only one date is recorded

    Hello community,

    I have the following problem:

    I automatically stores the datetime values in a date column "changed_on", whenever a user saves a form.

    Unfortunately, when I show this value in a form or report, only the correct date is shown. Still, the time is 00:00. There is no time in the database value, too.

    Whenever a user clicks the save button in my form, the value of "changed_on" is generated by a calculation that returns "sysdate" (see image below).

    I think I tried everything now, but I can't understand how to record the date and time correctly. I already tried the format for the changed_on field mask to my preferred format, but it does nothing (jj. MM YYYY HH24).

    How can I automatically record the date and time?

    You need two things.

    1. put the mask of the P3_CHANGED_ON element to JJ. MM YYYY HH24

    2. change your source of calculation to

    TO_CHAR (sysdate, ' DD.) MM YYYY HH24 ')

    In this way, what holds the element and implicit conversion happens when recording records will match.

    Thank you

    -Jorge

  • Insert the current date and time

    Stupid question. I watched the different applications that insert the date and time in a database field. I noticed that some applications use systematically function now() FC and others use a database such as sysdate or getDate function. Situations in which you want to use the function now() CF instead of a database function and vice versa?

    This helped. Thank you all.

  • How to include the install date and time in the registry keys

    Hi all

    I hope someone can help me. I'm creating a Setup program that includes properties in the construction specifications. I also wannt to include certain registry keys to add during installation:

    1. I understand the application installation directory by providing the key to [INSTALLDIR] value. This seems to work fine and I have no problem with that.

    2. the other key I would include (but I don't know how) indicates the date and the time of installation. Is it possible to automatically include this in a (similar to INSTALLDIR) registry key?

    I look forward to your expert advice!

    Kind regards

    Larry

    Larry,

    You can configure an exe must be run after Setup is finished. So, you can write a small application using the registry functions of Windows that retrieves the current timestamp and store it in some key.

    Norbert

  • How to find password to put in place the system date and time

    I have a dell computer used (vista), while mine is in the shop, the date system and time is not set. How to find the password of Setup/system to set the time and date. I set the time and date using the Panel control, but within a few hours, it changes again in May 3,2003 Help. Thank you

    [Moved from comments]

    If you have changed the time and date in the Panel, and he continues to return to an older date, then this is probably the CMOS battery that has gone dead. If it is a loan, I wouldn't worry on this subject. If it's your own old PC, then you can change it. Is this a laptop or desktop PC? What brand and model is it?

    SC Tom

  • I need to create a table that has each increment of 15 minutes between the current date and time in the past.

    I can around the current datetime object to the the last quarter of an hour and show all dates for last year, but I'm looking for all the 15 minutes for each day of '1 October 13' to the current date.

    Here's what I have so far:

    SELECT

    trunc (sysdate, 'mi')-

    NUMTODSINTERVAL (mod (to_char (sysdate, 'mi'), 15), 'minute') as Quarter_Hr,

    (sysdate-365 (LEVEL-1)) AS DATES

    FROM DUAL connect by level < = (sysdate-(sysdate-365))

    Any help would be appreciated. I use that as a dimension table to evaluate performance on a base quarter of an hour.

    ALTER session set nls_date_format = "hh24:mi:ss dd/mm/yyyy '.

    /

    Select date "'2013-10-1 + (level - 1) / 96 dt"
    of the double
    connect by level<= trunc((sysdate="" -="" date="" '2013-10-1')="" *="" 96)="" +="">
    /

    DT
    -------------------
    01/10/2013 00:00:00
    01/10/2013 00:15:00
    01/10/2013 00:30:00
    01/10/2013 00:45:00
    01/10/2013-01:00
    01/10/2013-01:15
    01/10/2013-01:30
    01/10/2013-01:45
    01/10/2013-02:00
    01/10/2013-02:15
    01/10/2013-02:30

    DT
    -------------------
    01/10/2013-02:45
    01/10/2013-03:00
    01/10/2013-03:15
    01/10/2013-03:30
    01/10/2013 03:45
    01/10/2013 04:00
    01/10/2013-04:15
    01/10/2013-04:30
    01/10/2013-04:45
    01/10/2013-05:00
    01/10/2013-05:15

    .

    .

    .

    DT
    -------------------
    06/08/2014-11:45
    06/08/2014-12:00
    06/08/2014-12:15
    06/08/2014-12:30
    06/08/2014-12:45

    29716 selected lines.

    SQL >

    SY.

  • How to convert number in date and time in labview

    Hi all

    I have a hexadecimal string and converted into a number. Now this number to display in the format of timestamp. Uses the format of the time Unix.

    By using this link, I can convert this number to timestamp.  http://www.UnixTimeStamp.com/index.php

    But how it should be done in LabVIEW? I know it may be simple, but please help.

    I enclose my VI for referance.

    Thank you

    Manisha

    Hi Man_Can,

    You can add the origin of UNIX timestamp to your number:

  • Windows Vista HP do not observe the right date and time

    Last week, I closed my laptop and two days later I turn it on. The clock and the time to September 9, 2007. This happened for the third time, and I can't use my windows that Messenger Essentials, IE do not open. Any idea about the error?

    Thank you

    Marlos Vilela

    Last week, I closed my laptop and two days later I turn it on. The clock and the time to September 9, 2007. This happened for the third time, and I can't use my windows that Messenger Essentials, IE do not open. Any idea about the error?

    Thank you

    Marlos Vilela

    I don't know what are wrong with can't open Messenger and IE, but I know what...

    Your computer is back to 2007 when you restarted it because...

    Your CMOS battery is history. You need a replacement.

    How to replace the CMOS battery
    http://www.computerhope.com/issues/ch000239.htm

    What is battery CMOS

    http://www.computer-hardware-explained.com/CMOS-battery.html

    ATTENTION: while the battery itself is very good cheap, be careful if you decide to replace yourself.
    It is better to have another friend who knows also computer be with you together.

    The safest way is to pay the Department store. But it will cost you.
    Your call.

  • The default date and time

    Hi all

    Thanks in advance for any help.

    Basically, I wrote a small pl/sql function to return a date according to what has been inserted in a field (start_date). I get

    Error:

    Call returned AJAX server error ORA - 01830:date format picture ends before converting all of the input string to set the value.
    BEGIN
    
      IF (to_date(:P18_END_DATE) < to_date(:P18_START_DATE)
          OR to_date(:P18_END_DATE) IS NULL) THEN
    
        RETURN to_date(to_char(:P18_START_DATE,'DD-MON-YYYY HH24:MI' ||'17:00'),'DD-MON-YYYY HH24:MI') ;
    
      ELSE 
        RETURN to_date(:P18_END_DATE,'DD-MON-YYYY HH24:MI') ;
    
      END IF ;
    
    END ;

    Mary,

    Try this

    DECLARE
       l_end_dt   date;
       l_start_dt date;
    BEGIN
      l_end_dt := to_date(:P18_END_DATE,'DD-MON-YYYY HH24:MI');
      l_start_dt := to_date(:P18_START_DATE,'DD-MON-YYYY HH24:MI');
    
      IF (l_end_dt < l_start_dt
       OR l_end_dt IS NULL)
      THEN
        RETURN (to_char(l_start_dt,'DD-MON-YYYY') || ' 17:00');
      ELSE 
    
        RETURN (to_char(l_end_dt,'DD-MON-YYYY HH24:MI'));
    
      END IF ;
    END ;
    
    Good Luck,
    Tyson Jouglet
    

Maybe you are looking for

  • Cannot burn DVD-R with my Satellite P100-342

    I bought a Satellite P100-342 two years ago. Some time after I tried to burn DVD + R and it was impossible, so I sent it to Toshiba. A few weeks later, when they returned to my laptop I saw that I can burn DVD + R, but it was not possible to burn a D

  • Presario c700: wifi drivers not be loading not

    Atheros ar5007 pilots not be loading not, says windows cannot load driver (code 31). I have reloaded the drivers, to C:\windows\system32\drivers\athr.sys with 9.1.0.328, turned the pc market and get the same message. Happened when I uninstalled a tas

  • I can't export my video because I get errors, please help!

    I use a Macbook Pro. Mac OS X Version 10.8.5 Processor: Intel Core i5 to 2.3 GHz Memory: 4 GB 1333 MHz DDR3 Final Cut Pro X Version 10.0.9 WARNING: I can't move to Mavericks like I have no way to back up my computer. So please don't tell me to level

  • Unable connect to the sequence editor of

    Hello I seem to have something broken in my version of TestStand 4.2. When I run the sequence Editor starts in the logged out State.  When I click on Login... nothing happens. I think this may have something to do with process templates - I had insta

  • Pro 100 reduced image on format letter

    Hi - am a person pretty savvy computer, but for the life of me can not find out how and why the 100 Pro cut output when printing of 8.5 x 11. Especially when it was working fine a month there. I try to print a label for shipping b & w simple. The pri