| | |
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 |
address anydbm app bash beginner changecolor cipher class clear conversion coordinates corners curves definedlines development dictionary dynamic events examples excel feet file float format function generator getvalue gui handling homework images import input ip java keycontrol line linux list lists loan loop maintain matching maze millimeter mouse mysqldb number numbers output parsing path port prime programming projects py2exe pygame pymailer python queue random rational raw_input recursion recursive scrolledtext searchingfile shebang singleton slicenotation split string strings table tails terminal text thread threading time tlapse tooltip tuple tutorial type ubuntu unicode url urllib urllib2 valueerror variable variables vigenere web wx.wizard wxpython xlwt






