Try searching the web. You don't think you're the first person who's ever needed to insert a line at the beginning of a file before, do you?
This page may be a good starting point:
By the way, in *nix filesystems there is traditionally NO "creation" date. There's only the time of last content modification (mtime), last inode change (ctime), and last access (atime).
The ext4 filesystem has added a creation time (crtime) flag to its metadata, but it isn't yet supported by most system tools, so it remains unused for now.
That is, unless you're talking about the exif tags of image files, or something. So it might help if you described your goals in more detail. Give us some actual examples or something.