Hello,

I'm trying to represent the system date in a sequence such as:
dd mm yy yy

So far i got:
dd mm yyy

so, the year is represented on 2 ytes, but I only have 3 characters, i need to split after the first character and then add a zero in from of the first character.

for example 2012 in hex = 7dc

I need to turn it in
07 DC

I could not find anything regardin spliting without a separator...
Any help is apreciated :)

>>> def split_hex(n):
	print '%02x %02x' % divmod(n, 256)
	print '%c%c' % divmod(n,256)
	return '%c%c' % divmod(n,256)

>>> split_hex(2012)
07 dc
Ü
'\x07\xdc'
>>>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.