how to convert ctime format to "%a, %b %d %Y %H:%M:%S" format?

hello,
I am just trying out some time code things, but apart from some persisting bugs -
how to convert ctime format to "%a, %b %d %Y %H:%M:%S" format?

Thu Jan 1 01:05:06 1970
should be
Thu, 1 Jan 1970 01:05:06

edit:
solved!