Jump to content

Recommended Posts

Posted

I saw a thread of this before but my situation is a little different.

I'm looking to spit out log file(s) and I would like this in this format;

"DD/MM/YYYY -- HH/MM/SS"

This is what I have so far;

$date = @MON&"/"&@MDAY&"/"&@YEAR
Posted

$date = @MON&"/"&@MDAY&"/"&@YEAR
$hour = @HOUR&"/"&@MIN&"/"&@SEC
$datetime = $date&" -- "&$hour

I don't see what the problem is here. You were well on your way to writing the solution and it seems like you understand what to do and suddenly you stopped? Why?

If you just copied the provided code then please try to understand it. Programming is not so difficult.

Posted

Strange, I was trying those before and it told they were invalid. Probably should've added that in my post.

Something similar happened before when my if/else/endif statements got out of place. It was corrected by re-pasting the code the window.

I'm not a beginner programmer either :P

I've been doing python for several months now and before that I had, and still have, a vast knowledge of PHP/Html/Css.

Posted

I'm not a beginner programmer either :P

I've been doing python for several months now and before that I had, and still have, a vast knowledge of PHP/Html/Css.

That makes you pretty much a beginner programmer. :unsure: Can't say I have much experience but after 4 years I feel much more confident than after a few months.

Just as a suggestion:

$datetime = @MON&"/"&@MDAY&"/"&@YEAR&" -- "&@HOUR&"/"&@MIN&"/"&@SEC

is much less readable than:

$dateTime = @MON & "/" & @MDAY & "/" & @YEAR & " -- " & @HOUR & "/" & @MIN & "/" & @SEC

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...