Skip to content

Instantly share code, notes, and snippets.

@sc68cal
Created April 18, 2011 19:29
Show Gist options
  • Save sc68cal/925996 to your computer and use it in GitHub Desktop.
Save sc68cal/925996 to your computer and use it in GitHub Desktop.
diff --git a/helix/hiv/forms.py b/helix/hiv/forms.py
index cbf4a56..5938603 100644
--- a/helix/hiv/forms.py
+++ b/helix/hiv/forms.py
@@ -4,7 +4,7 @@ from django.http import HttpResponseRedirect
from django import forms
from helix.hiv.models import *
from django.contrib.formtools.wizard import FormWizard
-from datetime import datetime
+import time
class AlcoholForm(Form):
current_use = forms.CharField(widget=forms.Select(choices=
@@ -203,7 +203,8 @@ class VisitForm(ModelForm):
if self.postdata["viral"]:
v.viral = self.postdata['viral']
if self.postdata["date"]:
- v.date = datetime.strptime(self.postdata['date'],'%m/%d/%Y')
+ date = time.strptime(self.postdata['date'],'%m/%d/%Y')
+ v.date = time.strftime("%Y-%m-%d",date)
else:
v.date = None
@@ -234,4 +235,4 @@ class VisitForm(ModelForm):
e = PatientExposedTo()
e.visit = v
e.exposure = Exposure.objects.get(pk=exp)
- e.save()
\ No newline at end of file
+ e.save()
@sc68cal
Copy link
Author

sc68cal commented Apr 18, 2011

CentOS seriously sucks. Python 2.4? Good lord.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment