Convert date time to file date time

Hi,
I have standard delphi function which conver datetime to filedatetime here is the description
function DateTimeToFileDate(DateTime: TDateTime): Integer;
Description
Use DateTimeToFileDate to convert a TDateTime value, which is the representation of date-and-time values used by the VCL, to a DOS date-and-time value.
For example, use DateTimeToFileDate to convert a TDateTime value to a
format that can be used as the Age parameter of FileSetDate. You may
also need to use DateTimeToFileDate to convert a TDateTime so that it
is compatible with the Time field of the TSearchRec record used by the FindFirst
and FindNext functions.
Lo returns the low-order Byte of the argument X as an unsigned value. X is an expression of type Integer.
Use Hi to obtain the high-order byte of an expression of type Word or Integer.
Note:     Hi treats Integer as a 16-bit value, even if it is 32-bit.
This is the delphi code that convert the date
year=2003
month=5
day=28
sec=57
min=45
hr=13
msec=107
LongRec(Result).Lo := (Sec shr 1) or (Min shl 5) or (Hour shl 11);
LongRec(Result).Hi := Day or (Month shl 5) or ((Year - 1980) shl 9);
output Result is --> 784100796
Any help will be highly appreciated.
Thanks.

You use the java.util.GregorianCalendar to extract month, day, etc from a date.
Then you use the shift operator ('<<') to construct the number.

Similar Messages

  • HELP!!!!   How to read data from a file at time to time?

    i store temporary string data in a file(the data changes always), and i need to read the data in the file from time to time, so how can i read from the file like every 5 seconds?

    Please i need your help mr. noahw. i have a timer called timer1 inside that timer i am starting a thread to read the data in a file to me, then i have another timer timer 2 in which it takes the data already read from timer 1 and draws them on a GUI. the problem with me is that, i am unable to set a correct time for each of the two timers such that, every time timer one executes that is a new data is generated i need to draw only one figure coreesponding to those data, then when a new set of data is read i need to draw another figure based on the new data read, please help me with this becasue i need it urgently, this is my email, [email protected], and i can offer this reply as many points as you want if this helps you to help me, i am counting on you.

  • Data source doesn't show porper data while flat file data loading

    Hi Experts,
    I am trying to load data from flat file for info object 0GL_ACCOUNT. I have created an application component and data source.
    My question is after loading text data in the corresponding data source, it shows only few characters of the actual data.
    For Ex. in my original data i have G/L account name "Comp Hardware Purchase" but after loading into the data source it shows only "Comp Hardwa".
    I want to show the whole name "Comp Hardware Purchase ".  I know there is some text length problem but i couldn't find it. What steps i need to follow?
    Please help.
    Full points will be given to the useful answers ****
    Thanks and Regards,
    Niranjan Chechani

    HI Niranjan,
    Go to your data source and check whether the field and infoobject are having the same lenght. If the infoobject lenght is less than your field lenght wihc is coming from Flat file then such issue occur.
    Search for your flatfile datasource and and doubel clik on the datasource and check the fileds tabs, there you will have the mapping or you can also check your Transfer or Update rules of  the target.
    Regards,
    Nanda.S

  • Write data to a file wth time

    Hi,
    I am trying to record some data and time in a text file that I would be able to open the data file in Excel later. I have worked on the program and it works but I have some questions, and I would appreciate if somebody can help that I would be able to improve my code.
    1) I wrote the data in a spreadsheet (test1 vi), however I read in the discussion forum that this not the best way to record the data since it slows down the program, and I am trying to run my code in a high sampling rate. So, I tried to write the data in a text file (test 2 vi), now the data is written 5 times for each time step (text file attach). Can somebody give me any suggestion what is wrong with the code that record the data more than one for each loop?
    2) I am recording the time by using Tick count inside and outside the loop. Is there any better way to record the time?  
    Thanks a lot,
    Azadeh

    Files are attached
    Attachments:
    test3.txt ‏275 KB
    test1.vi ‏138 KB
    test2.vi ‏146 KB

  • AD date stamp OR File date stamp?

    Hi,
    Im in the process of evalutating software to archive files to cheaper storage based on size and date stamp.
    Problem, we unfortunately migrated from eDir to AD 2.5 years ago and products used thus far use the AD date stamp from when we migrated which is not useful.
    My question is, does storage manager archive base on the date stamp of the file?
    I know we have files that havn't been modified for more than 10 years.
    Is there a way around this?
    Thanks
    Albert

    Not using anything at the moment.....basically looking fo something that will do the job.
    Will look at dynamic files serveices.
    thanks :-)
    Originally Posted by jmarton
    asabadin wrote:
    > Im in the process of evalutating software to archive files to cheaper
    > storage based on size and date stamp.
    >
    > Problem, we unfortunately migrated from eDir to AD 2.5 years ago and
    > products used thus far use the AD date stamp from when we migrated
    > which is not useful.
    >
    > My question is, does storage manager archive base on the date stamp of
    > the file?
    >
    > I know we have files that havn't been modified for more than 10 years.
    >
    > Is there a way around this?
    How are you archiving files? Are you using a grooming rule? If so,
    you can specify a filter based on create/modify/access time. This may
    help for archiving files to the vault via grooming. However, to be
    honest if you're wanting to archive files to cheaper storage then a
    better option is Novell Dynamic File Services for Windows.
    https://www.novell.com/products/dynamic-file-services/
    This gives you the option of moving files to cheaper storage but still
    being accessible "online" by your users, or truly archiving them to
    cheaper storage (or even the cloud) and only archive managers have
    access to files. It's been a while since I last looked at NDFS but I
    believe you can configure policies there as well based on
    create/modify/access time.
    Your world is on the move. http://www.novell.com/mobility/
    Supercharge your IT knowledge. http://www.novell.com/techtalks/

  • Data Load Rule file -Date conversion

    Hi,While working on a Dataload rule file,I was facing this problem.I'm getting date in the format "m(m)/d(d)/yyyy hh:mm:ss". Is there a way to change this to "mm/yy" ??(There won't be anyproblem if I get mm/dd/yyyy hh:mm:ss style. but unfortunately not.)

    Can you run the file through a "conversion process" prior to loading?We do similiar thing here. We get a feed from Hyperion Enterprise and run it through a home grown conversion utility written in Windows Script before we load into Essbase.It reads in the file line by line and then writes out a new file properly formatted.

  • If xmp creation date precedes raw file date Bridge/ACR does not recognize

    I decided to start a new thread with this revelation from a prior discussion, because of its importance.
    I have several iPad apps that apply metadata to raw images captured in the field using the camera connection kit.  These apps have various export mechanisms, with a typical capability to bundle up raw images from the Photos app space with xmp files from the metadata editor app's space, and deliver them via ftp or however.  I have seen failures where the creation date of the image file was made equal to the creation date of the xmp, and subsequent to export Bridge would not recognize the xmp file as valid edits to the raw file, even though they both had the same file name ahead of the extension.  Up to now I never understood the cause of the failure.  Opening the xmp file in a text editor and saving it out with a later creation date "fixed" the problem.
    Adobe either needs to change this behavior (IMO the right solution, forget about checking creation dates) or at least publish the dependency.  I believe there are a lot of programmers out there that had no idea that the creation date could invalidate the coupling between the raw file and the xmp file.
    Richard Southworth

    Ok, made some tests.
    First: there is nothing interesting in /sys/class/drm. Only one file called version... which, as you might guess, contains the version info for DRM.
    Secondly: tested this Phantom Output thing. Used LVDS-1, LVDS-0, LVDS... nothing.
    I even tried to add i915 and intel_agp modules to the initramfs... nothing changed.
    However, I looked a bit more into dmesg and found another interesting thing:
    [ 2.038447] Linux agpgart interface v0.103
    [ 2.041261] input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A08:00/LNXVIDEO:01/input/input8
    [ 2.048750] ACPI: AC Adapter [ACAD] (on-line)
    [ 2.060820] agpgart-intel 0000:00:00.0: Intel 945GM Chipset
    [ 2.060849] agpgart-intel 0000:00:00.0: detected gtt size: 0K total, 0K mappable
    [ 2.060858] agpgart-intel 0000:00:00.0: Intel (null) Chipset
    [ 2.060867] agpgart-intel 0000:00:00.0: can't determine aperture size
    [ 2.060933] agpgart-intel 0000:00:00.0: agp_backend_initialize() failed
    [ 2.060942] agpgart-intel: probe of 0000:00:00.0 failed with error -22
    So it seems there is a problem with the AGP module not correctly detecting the card in the first place
    Edit: also tested it with the internal screen connected, still the same problem.
    Last edited by kjans (2014-12-03 21:33:09)

  • Remove duplicates while loading data from text file

    Hi,
    Data in text file (some times has duplicates) is being loaded into Oracle 9i database using Informatica. To improve performance, we would like to remove duplicates at the time of each load using Oracle procedure. Could you please help me with this?
    Thanks,
    Lakshmi

    No, our table doesn't have that. Most of the functionality is managed at the informatica level. Is there any other way? Thanks,

  • Write to File Multiple times WTK 2.5.2

    Hello All
    I am trying to write to a file multiple times (in WTK 2.5.2 on Win XP SP2). So I create a FileConnection and create a PrintStream with it. Using the PrintStream I write data to the file multiple times.
    The problem I am facing is that the write happens the first time (after the usual security prompts) and not after that. The code is below. The second time onwards the security prompt displayed does not get closed and the application remains non responsive
    public class IOWriter {
         private PrintStream out;
         public IOWriter() {
              String sMemCardRoot = System.getProperty("fileconn.dir.memorycard");
              String sFileName = "System.out.txt";
              try {
                   FileConnection fc = (FileConnection)Connector.open(sMemCardRoot + sFileName, Connector.READ_WRITE);
                   if(!fc.exists()) {
                        fc.create();
                   out = new PrintStream(fc.openOutputStream());
                   println("Initialized");
              } catch (Exception e) {
                   e.printStackTrace();
         public void println(String sData) {
              if(null != out) {
                   if(null == sData) {
                        sData = "";
                   out.println(sData);
                   out.flush();
         public void unInit() {
              out.close();
    }I have set the fileconn.dir.memorycard System property to a folder
    I have been trying to debug this in the WTK for some time now. have not tested on a device yet. Let me know if you could identify the problem.
    Thanks & Regards
    Edited by: SonieThomas on Jan 19, 2009 1:51 AM
    Edited by: SonieThomas on Jan 19, 2009 1:54 AM

    It sounds like you need to Use the open\create\replace VI to open a data file and get a reference to it. You use the Write File node to write the data, specifing the start pos as 0, and the offset as the current file marker. When you're done with the data file, you use the Close File node to release the file reference.
    I've written a Sub VI that should do what you want, or come close. Take it apart and see how it works. I'm including a VI that uses the Sub VI to create and append text data.
    I hope this helps!
    John Wilson
    Sanders Engineering & Analytical Services, Inc.
    Mobile, AL
    251-633-4120
    [email protected]
    Attachments:
    test_writing_gpib_data_file.vi ‏26 KB
    write_gpib_data_string.vi ‏84 KB

  • Error in loading  transaction dat from flat file

    hi everybody
    while i try to load  data from flat file at time of  scheduling it shows the error "check load from infosourceand its showing  errorwhilw monitoring the data as follow"the  correcsponding datapacket were not updated using psa" what can  i do to rectify the  problem
    thanks in advance

    Hi,
    Please check the data whether it is in a correct format using the "Preview" option in the infopackage.
    Check whether all the related AWB objects are active or not.
    Regards,
    K.Manikandan.

  • Importing date-time data from Excel file

    I am running into problems importing date-times in the format 3/15/2010 9:30:00 PM using SQL Developer. At Step 1 of the Data Import Wizard, the data preview window displays all the date fields as Excel dates (e.g. 40252.89583 instead of 3/15/2010 9:30:00 PM). Can I get SQL Developer to recognize the data in their date-time format, rather than converting them to decimal values?

    When importing from Excel, I haven't found a date format model that would convert their decimal number into an Oracle date. But the following seems to work well:
    1 - Save the Excel page as a CSV file then in the SD import wizard you can enter the date format model for that column.
    2 - In Excel convert that column to text. (Highlight your date column, Choose the "Data" menu item, in the "Data Tools" group choose the "Text to Columns" tool, click next / next / then select the "Text" button, click "Finish" and save your xls) Now in the SD import wizard just enter the date format model that matches the Excel 'text' column with your dates.
    Either way seems to work for me.

  • Belle: File dates ignore time setting (uses GMT)

    I've come to discover that the device uses GMT in relation to file creation / modification dates and ignores the time zone setting. I was kept unaware of this by being able to use Nokia Multimedia Transfer to import camera files to iPhoto. Having to connect USB in Mass Storage mode reveals this limitation. However I am not at all sure if this was the case prior to Belle, though I assume so.
    Seems like a oversight in the core of the OS, but if not please fix this. The time zone setting should be more than cosmetic. File dates should not be disregarded on a device that can handle as many files and file types as modern smartphones (N8-00 here) can. It *is* important.
    Also, update all your software for Macintosh while you're at it, please.
    TIA!

    Thanks for the answer, I read everything except the man page for mktime :-(
    Well I can't remember where I read that about "gmtime" but you are right:
    I will use gmtime instead of mktime and it works, it converts it to a GMT time.
    Thanks again for your precious help.
    Cheers,
    Gilles

  • How often in the real time projects extract data from flat files n process

    I am going thru teh BODS data integrator, and trying to understand the demand of ETL services extract data from a flat file, is that really impt in teh real time jobs.
    Thank you very much for the helpful info.

    Hi,
    As per the inputs given by you guys i started loading data from flat file.
    I try to load 28 files from i which i was able to load 24 files succesfully.For the other 4 i got this error messages
    1) Error 'Enter period in the format __.YYYY...' at conversion exit CONVERSION_EXIT_PERI6_INPUT (field CALMONTH record 1, value DUMYTRA)
    Message no. RSDS012
    2)  a) Error 'The argument '1,008.00' cannot be interpreted as anumber' on assignment field QUANT_B record 11714 value 1,008.00
    Message no. RSDS013
       b) Error 'The argument '1,110.00' cannot be interpreted as anumber' on assignment field QUANT_B record 15374 value 1,110.00
    Message no. RSDS013
    3) a) Error 'The argument '1,140.00' cannot be interpreted as anumber' on assignment field QUANT_B record 1647 value 1,140.00
    Message no. RSDS013
       b) Error 'The argument '2,028.00' cannot be interpreted as anumber' on assignment field QUANT_B record 4625 value 2,028.00
    Message no. RSDS013
    4) Error 'The argument '1,151.00' cannot be interpreted as anumber' on assignment field QUANT_B record 7808 value 1,151.00
    Message no. RSDS013
    I'am unable to trace out what is the error exactly.
    I checked this values in files they are perfect.
    can anybody please guide me on this issue.
    With Regards,
    Pradeep.B

  • Converting a date time to a date only

    Post Author: Dockman
    CA Forum: Formula
    I am working on a report that has a running total field.  The running total field keeps a running total and resets every time that a date changes.  the problem is that my dates include times, therefore the running total resets on every line.  How can I convert my date (in date time format) to be only a date so that it does not reset on every line?
    Obviously, I am not a programmer so I apologize if this is a stupid question.

    Post Author: yangster
    CA Forum: Formula
    if you are doing it inside crystal you can use the date functiondate({your.datetimefield})if you are doing it at the db level in a command this will vary depending on your db

  • How to get local file date and time ( 10g version )

    Hi,
    Would like to ask if there is any way to get the date and time of a local file. It seems that webutil does not have this function.
    And I want to use client_host ( dir c:\file.txt > c:\temp.txt ) and the read this file to get the file date.
    But the problem is the file date and time ( in the dir ) varies in different PCs.
    Best Regards,
    Ivan

    But the problem is the file date and time ( in the dir ) varies in different PCs.
    You mean the format of the date and time don't you?
    If so you maybe could create a java bean which does that for you using the lastModified Method of the File class.
    regards

Maybe you are looking for

  • Script for Preprinted continues label print

    Hi All, I am developing one script in that the stationary was preprinted one with label dimensions of 10 CM width 7 CM height. For this dimensions I had created new page format and assign to device type EPESCP. Problem: I am printing my label on dot

  • How do I find my iPhone using my mac

    I'm not sure where to login or go.. to locate the iphone thanks Joe

  • F9k2 - Unable to add Business partner as Bank statement recipient

    Hello experts, I am having trouble with adding a BP number under the Bank statement tab of Change Bank account screen, i.e. bank account change: Account statement screen. Can someone please help me understand, why is this happening. How can I make th

  • Cant't see videos in videos tab

    unfortunately I had to restore my library from my back up discs. That went fine but my videos arent organized under the videos tab, i have tried to do it manually but I can't. Is there a way to do this? Please Help.

  • BIOS updates? -- Syslinux problems

    Are BIOS updates even possible/safe in Linux?  I bing'd it and read an article about using flashrom, so I did a quick $ pacman -Ss flashrom and noticed that we've got it in our repos, which I remember already knowing, so I'm now wondering why did I e