Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Create Timestamp and append it with existing input date field

  1. #1
    Junior Member
    Join Date
    Feb 2019
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Create Timestamp and append it with existing input date field

    I have to derive the timestamp value and append it to the existing date field and populate it in the target output file. This should be unique for every id field & col3.

    My Input:

    id line col1 col2 col3(mmddyyyy)
    1 1 abc 123 01012018
    1 2 cba 432 01012018
    1 3 xyz 463 01012018
    2 1 tew 321 02012018
    2 2 abc 422 02012018
    3 1 tef 001 10052018
    4 1 hrg 963 03202018

    For the above given sample data the target output field should be populated with timestamp attached. For every time mapping run the Hour(HH) value should be starting from 09 AM.

    Expected Output:

    Target output Field Format - MMDDYYYYHHMMSSmmm Where MMDDYYY - col3

    HH (Hour) - Should always start from 09 MM (Minute) - start value 00 and max value 60 (Increment hour by 1 when it reaches 60 and reset this to '00')

    SS (Seconds) - start value 00 and max value 60 (Increment Minute by 1 when it reaches 60 and reset this to '00')

    mmm (milliseconds) - start value 000 and max value 999 (Increment seconds by 1 when it reaches 999 and reset this to '000')

    Please do let me know if need any additional informations on my question.

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    22,320
    Thanks
    53
    Thanked 2,392 Times in 2,346 Posts

    Default Re: Create Timestamp and append it with existing input date field

    What have you tried?
    What problems are you having?
    Do you have any specific java programming questions?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. append to text field declared out of class
    By chopficaro in forum Java Theory & Questions
    Replies: 1
    Last Post: July 25th, 2012, 03:23 PM
  2. scope problem: append to text field declared out of class
    By chopficaro in forum Java Theory & Questions
    Replies: 2
    Last Post: July 14th, 2012, 03:21 PM
  3. How can I append an existing file in Java?
    By diyaots in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: February 8th, 2012, 10:26 AM
  4. How to get unix timestamp from formatted date?
    By snytkine in forum Java Theory & Questions
    Replies: 5
    Last Post: October 12th, 2010, 08:07 AM
  5. How to append data to an already existing file?
    By siteregsam in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: May 3rd, 2010, 02:31 PM

Tags for this Thread