I am trying to create a new list through an understanding of the list, but I want these new values to be included in the existing list.
In particular, I am trying to create a string from a date and will have some string formatting between the values (dash -). The existing list will be a template if you are with a dash.
Here is what I still have:
{Date, Time} = erlang:universaltime().
DateList = tuple_to_list(Date).
DateListString = [ integer_to_list(X) || X < DateList ].
DateListStringConcatenate = lists:flatten(DateListString).
The result should be something like "20101121"
But I want "2010-11-21"
So, I am thinking about understanding the DateListString of "comprehending" an existing list with a "-" after the first and second elements.
Any suggestions followed by specific code examples are greatly appreciated.