I would like to know whether there is any function that I can use to get the candle date.
Ex: if I have 30 daily candle, I want to print the candle date for each of those candles. Is there a function for this in mql?
You can use the Time series array, or the the iTime() function.
You can also use the CopyTime(), CopyRates(), or ArrayCopyRates() or ArrayCopySeries() but these are less well known and more complex in MQL4.