Dayshift/Nightshift field based on time of day

Joined
Mar 25, 2011
Messages
1
Reaction score
0
Greetings All,

I have been trying to create a field that will display "DAYSHIFT" before noon and "NIGHTSHIFT" after. This is rather difficult, since I can't find anywhere an explanation of how Word parses date/time values. To get around that, I have tried the two following field codes:

{If Time \@"HH" < 12 "Dayshift" "Nightshift"}
{If Time \@"am/pm" = am "Dayshift" "Nightshift"}

Both of these yield the result "NIGHTSHIFT" now, and also when I switch the system time to AM.

Can someone please tell me what I'm doing wrong?

thanks.

ak
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top