Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

just a poke at python

Name: Newb oreo 2012-08-03 20:40

Hello, im new to python and programming in general. I have a small Dates problem that is getting me a little stuck in my progress. I currently am using the Codecademy approach to sort of reduce the fear of learning this foreign language.

from datetime import datetime
now = datetime.now()
print now
current_hour = now.hour
current_minute = now.minute
current_second = now.second
print str(now.month) +"/"+ str(now.day) +"/"+ str(now.year) +" "
+ str(now.hour) +":"+ str(now.minute) +":"+ str(now.second

I am able to generate the current date and time and I understand how to concatenate the strings and I somewhat understand the str()'s role in the problem. My issue and I apologize as my english is subpar but merjing the two dates together in a one line output but also keeping the proper format has been difficult. For example I must have the output produce a result in the form of mm/dd/yyyy hh:mm:ss which I can do individually however I run into issues when trying to merge them. if that makes no sense I will try to rewrite the body of this message again. Thank you for your comments!

Name: Anonymous 2012-08-03 22:12

>>7
>implying your not a huge faggot

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List