That will work, as long as the parent doesn't need to go back into a native object easily - if s/he needs to easily get back into a datetime object, use pickle:
import pickle import base64 toEncode = pickle.dumps(datetime.now()) encoded = base64.encodestring(toEncode) decoded = base64.decodestring(encoded) original = pickle.loads(decoded) #Gives a datetime object back out On Jul 30, 4:35 pm, Luke Seelenbinder <luke.seelenbin...@gmail.com> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > convert it to a string: str(datetime.now()) > > Luke > luke.seelenbin...@gmail.com > > "I [may] disapprove of what you say, but I will defend to the death your > right to say it." -- Voltaire > > Asinox wrote: > > hi guys, i want to encrypt the "datetime.now()" , im try with base64 > > but base64 need string... how ill encrypt ? > > Thanks :) > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > > iEYEARECAAYFAkpyBAIACgkQXQrGVCncjPylkACgmeeVS61T62myd/v+cxIlqxU3 > 9VkAn0QFoQwGBJFFvzsSO/FOLuFrtVcy > =KS21 > -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---