[reportlab-users] Re: Fw: Date and timestamp

Robin Becker reportlab-users@reportlab.com
Thu, 14 Aug 2003 10:55:45 +0100


In message <3F3B5875.000001.03436@MONSTER>, diab AL-KUDAIRI <diab@al-
kudairi.fsbusiness.co.uk> writes
> 
>
> 
>
>Hello,
>
> 
>
> 
>
>could you tell me how I can get a time and date stamp so it will show on the
>canvas?
>
>basic code if possible?
>
> 
>
>Thanks.
>
> 
>
>P.S reportlab is amazing.



#try this
def run():
        from reportlab.pdfgen.canvas import Canvas
        import time
        c = Canvas('rl_hello.pdf')
        c.setFont('Helvetica-Bold', 36)
        c.drawString(100,700, 'Hello World')
        c.setFont('Times-Roman', 14)
        c.drawString(100,600, time.asctime(time.gmtime()))
        c.save()

if __name__=='__main__':
        run()
-- 
Robin Becker