Alex K Posted August 15, 2005 Posted August 15, 2005 Hi Guys, I can't seem to figure this one out, it should be simple and I've just spent the last hour friggin' around and getting nowhere (maybe i'll have to downgrade my status to novice). I have a script that inserts the date and time into 2 seperate fields formatted eg. date "Mon, 15 Aug 2005" and "10:35:42 PM" respectively. I have a calculation that concatenates them with some extra text ie. "Last Modified: Date @ Time bla bla. The problem is that although I have used the functions TextToDate(Date)/Time etc... the calculation displays the date and time in the wrong format ie. "Last Modified: 15/08/2005 @ 22:35:42" which is not the format that I want. What the? Please help :bang:
Søren Dyhr Posted August 15, 2005 Posted August 15, 2005 One among several could be this one: "Last modified: " & DayName ( aDate ) & " " & Day ( aDate ) & " " & MonthName ( aDate ) & " " & Year ( aDate ) & " @ " & Time ( Mod(Hour ( aTime );12) ; Minute ( aTime ) ; Seconds ( aTime ) ) & Case(-1+Int((Hour ( aTime )/12));" AM";" PM") You might exchange the ";" if your OS prefs demands it!! --sd
comment Posted August 15, 2005 Posted August 15, 2005 Alternatively, if this for display only, type the following directly on the layout: Last Modified: <> @ <> bla bla Select the new text object by clicking on it once, then format the date and time in the same way as you have done for the fields.
Alex K Posted August 19, 2005 Author Posted August 19, 2005 Excellent! Thanks very much comment!, that's exactly what I needed. thanx also to Soren. I didn't try that method but I'm sure it would have worked also.
Recommended Posts
This topic is 7104 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now