| | |
displaying date problem
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Feb 2009
Posts: 9
Reputation:
Solved Threads: 0
i need to be able to have python spit out a date like this (mm/dd/yyyy) even if the user doesnt add the "/" to there input. here is what i got so far.
import string
date = raw_input(enter your date:")
print date[0:2]+'/',date[2:4]+'/',date[4:8]
the output is mm/ dd/ yyyy.
how would you go about getting rid of the blank spaces in front of dd and yyyy?
import string
date = raw_input(enter your date:")
print date[0:2]+'/',date[2:4]+'/',date[4:8]
the output is mm/ dd/ yyyy.
how would you go about getting rid of the blank spaces in front of dd and yyyy?
![]() |
Similar Threads
- how to display calendar through php in html table (PHP)
- Displaying date from mysql (PHP)
- help please, displaying content problem (PHP)
- pagination not displaying results (PHP)
- date comparison (JSP)
- Date fields imported from access file to excel spreadsheet is converting to number (Visual Basic 4 / 5 / 6)
- Problem with displaying data.. (PHP)
- Displaying Data in C programmming (C)
Other Threads in the Python Forum
- Previous Thread: Redirect(link) code in Python
- Next Thread: Strip u' Unicode character from List
| Thread Tools | Search this Thread |
Tag cloud for Python
accessdenied apache application argv beginner book change code color converter dictionary dynamic edit editing enter examples excel file filename float format ftp function gui homework import inches input java keyboard lapse library line lines linux list lists loop microphone mouse movingimageswithpygame mysql newb number numbers numeric output parameters parsing path phonebook port prime program programming projects py2exe pygame pyopengl pyqt python random recursion recursive redirect remote reverse scrolledtext server session simple smtp software sprite ssh statictext string strings syntax table tennis terminal text thread threading time tkinter tlapse trick tuple tutorial ubuntu unicode unit urllib urllib2 variable windows wordgame wxpython






