SD Module - Writing timestamp to txt file & data from sensors

You can use something like below

What is the point in having a function return a global variable?