These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Need the Date and Time to print a certain way - what's the secret?

MarlaZ
Registered: Apr 28 2010
Posts: 112
Answered

I have a Visible (Print Only) Date/Time field that the doc owner wants to have printed out this way:

07-Jul-2010 14:45

So the Date is DD-MMM-YYYY but the time is military time, 24 hour time, just the hour and minutes. No seconds.

Do I need a script to do this? If so, would someone happen to know it?
I've been looking around and in books and help files, but have found nothing that works, so far.

OR

Is there a particular Pattern to use to get this?
Is there something I am not seeing?

I have learned just about everything I know of JavaScript, the script editor, and LiveCycle Design from the great folks on this and other boards. I hope someone can help me with this (hopefully) last piece of the puzzle!

Thanks

Marla

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
If you want the date/time field showing the current date/time in this way DD-MMM-YYYY 12:23:45 use this pattern:

date{DD.MMM.YYYY} time{HH:MM:SS}

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

MarlaZ
Registered: Apr 28 2010
Posts: 112
Will that give me the 24-hour military time?

and do I just stick this in the script editor on the top, with the Current Date Object selected?

This part is in FormCalc.

Marla

radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Ähm, no.

Military time only uses the full hours, no minutes or seconds, right?!
Then you better use another way.

Try this FormCalc script in the layout:ready event.
$ = Concat(Num2Date(date(), "DD-MMM-YYYY"), " ", Num2Time(time(), "HH"), "00")

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

MarlaZ
Registered: Apr 28 2010
Posts: 112
Oh, that is SO close!

The Date is just right.

The time needs to have a colon (:) between the hour and the minutes like this:

14:24

Also, I just tried it and it stated 1000 - which is 10:00 (ten o'clock) but it is actually 11:00 here. How do I set it for Eastern Standard Time (America, East Coast)?

Thanks!

Marla

radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
It the time displayed correct on your PC?

$ = Concat(Num2Date(date(), "DD-MMM-YYYY"), " ", Num2Time(time(), "HH"), ":00")

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Military time format use 0-24 for hours (no meridian indicator), 0-59 for minutes, 0-59 for seconds and an alpha character for the timezone. 'Z', phonetic 'Zulu', indicates the Greenwich Meridian Time and then users need to adjust for local time and Daylight Savings Time as needed.

George Kaiser

MarlaZ
Registered: Apr 28 2010
Posts: 112
radzmar wrote:
It the time displayed correct on your PC?$ = Concat(Num2Date(date(), "DD-MMM-YYYY"), " ", Num2Time(time(), "HH"), ":00")
-----

I think the code might not be quite right for the seconds because the code has 00

and I'm thinking that it has to somehow read seconds, not have a set value.
Am I on the correct track?

Could it not say "HH":"SS" or something like that?

I am only guessing here.

Marla

MarlaZ
Registered: Apr 28 2010
Posts: 112
gkaiseril wrote:
Military time format use 0-24 for hours (no meridian indicator), 0-59 for minutes, 0-59 for seconds and an alpha character for the timezone. 'Z', phonetic 'Zulu', indicates the Greenwich Meridian Time and then users need to adjust for local time and Daylight Savings Time as needed.
So that tells me what it uses but not how I can use it. Would you like to elaborate so I can understand and use it?

Marla

MarlaZ
Registered: Apr 28 2010
Posts: 112
Right now the time here is 11:15.
Below is a copy/paste of my actual date/time field.

06-Jul-2010 1100


So you can see that though the date is correct, the time is not quite right.

Marla

MarlaZ
Registered: Apr 28 2010
Posts: 112
radzmar wrote:
It the time displayed correct on your PC?$ = Concat(Num2Date(date(), "DD-MMM-YYYY"), " ", Num2Time(time(), "HH"), ":00")
Radzmer, are you still available for help?

We're almost there. I just need to know how to make the minutes show up, and the time has to be in Military style, one 24-hour instead (stattdessen) of 2 twelve-hour cycles.

Appreciate your help
danke

Marla

MarlaZ
Registered: Apr 28 2010
Posts: 112
Hello?

Is someone there who can help me with the 24-hour time portion of my date/time field??

Is this the end?

gkaiseril, will you not expand upon what you wrote earlier and offer help?

I am not a javascript or formcalc user. I'm really trying to find answers elsewhere. I do look to you for your expertise and assistance.

Thanks

Marla

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
I was responding to the statement that 'military' time only has hours. In Basic Training, we were taught how to tell time in the military format and that included minutes. On the communications I received, the transmission time, as is done in all commercial and armature radio communications, the time of trans mission was recorded in 24 hour format restated to GMT or UTC, Universal Time Coordinated, time.

You can specify the field to be a 'Date/Time Field' with a format of 'Date and Time' and the data pattern that you want. For the system date and time you can use the following calculation script:
// Current Date and Time in the "DD-MMM-YYYY HH:MM:SS" format$.rawValue = Concat(num2date(date(), "DD-MMM-YYYY"), " ", num2time(time(), "HH:MM:SS"))

The data pattern you will have to enter is "date{DD-MMM-YYYY} time{HH:MM:SS}"

George Kaiser

radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Yep,

I'm here.
But I think I lost the thread.
What way you wish the time has to look like?
With or without minutes and/or seconds?

Also, check this URL for militay time explaination:
[url]http://www.spacearchive.info/military.htm[/url]

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

MarlaZ
Registered: Apr 28 2010
Posts: 112
radzmar wrote:
Yep,I'm here.
But I think I lost the thread.
What way you wish the time has to look like?
With or without minutes and/or seconds?

Also, check this URL for militay time explaination:
[url]http://www.spacearchive.info/military.htm[/url]
------------------------

Thanks!

The time should look like:

14:27

which means 2:47 pm.

Marla

MarlaZ
Registered: Apr 28 2010
Posts: 112
gkaiseril wrote:
I was responding to the statement that 'military' time only has hours. In Basic Training, we were taught how to tell time in the military format and that included minutes. On the communications I received, the transmission time, as is done in all commercial and armature radio communications, the time of trans mission was recorded in 24 hour format restated to GMT or UTC, Universal Time Coordinated, time.You can specify the field to be a 'Date/Time Field' with a format of 'Date and Time' and the data pattern that you want. For the system date and time you can use the following calculation script:
// Current Date and Time in the "DD-MMM-YYYY HH:MM:SS" format$.rawValue = Concat(num2date(date(), "DD-MMM-YYYY"), " ", num2time(time(), "HH:MM:SS"))

The data pattern you will have to enter is "date{DD-MMM-YYYY} time{HH:MM:SS}"
----------------------
Nope, the date pattern doesn't work for what I need.
I need the following combination:

06-Jul-2010 14:25

No seconds at all. Military (24-hour) time. NO SECONDS.

I see that there are "patterns" but they do not let me know what is displayed when the pdf is printed out.

Here are the patterns I see on the Display and Data tabs of the Patterns - Time Field dialog

time.default{}
time.short{}
time.medium{}
time.long{}
time.full{}

None of these appear to give me what I want. Hence, I am looking at the scripting window.

Marla

radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Well,

the thing with the military time irritated me.
You simply want to show the time with hours and minutes.

So the code for the date field then is:
$ = Concat(Num2Date(date(), "DD-MMM-YYYY"), " ", Num2Time(time(), "HH:MM"))

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

MarlaZ
Registered: Apr 28 2010
Posts: 112
Thank you Radzmar!!!! I waited until 1:00pm and checked and it showed up as 13:00! Exactly what I need!

Thank you so much!
Viele Danken!!

Marla

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
MarlaZ,

You should be able to change for format by removing the seconds character from the formatting pattern.
// Current Date and Time in the "DD-MMM-YYYY HH:MM" format$.rawValue = Concat(num2date(date(), "DD-MMM-YYYY"), " ", num2time(time(), "HH:MM"))

George Kaiser

MarlaZ
Registered: Apr 28 2010
Posts: 112
thank you.

Marla

MarlaZ
Registered: Apr 28 2010
Posts: 112
OK, now I get the following error message:
-------------------------------------------

Script failed (language is formcalc; context is
xfa[0].form[0].form1[0].#pageSet[0].Page1[0].TableELN[0])
script=
$=Concat(Num2Date(date(), "DD_MMM_YYYY"), " ", Num2Time(time(),
"HH:MM"))

Error: Invalid property set operation; subform doesn't have a default property

Script failed (language is formcalc; context is
xfa[0].form[0].form1[0].#pageSet[0].Page1[0].TableELN[0])
script=
$=Concat(Num2Date(date(), "DD_MMM_YYYY"), " ", Num2Time(time(),
"HH:MM"))

Error: Invalid property set operation; subform doesn't have a default property

-----------------------------------------------

Any clues as to what is going on here? Have I done something wrong? I need to fix this so it does not appear when we open the dynamic pdf in either Acrobat OR Reader.

Thank you......

Marla

LeeRain
Registered: Jul 7 2010
Posts: 3
Thank you very much
__________________
[url=http://www.onlinedatingportfolio.com/]Online Dating Reviews[/url]
[url=http://www.myhealthysexlife.com/category/health-articles/]Healthy sex[/url]

Lee Rain