Tested your program. Works fine. And you fixed my bugs (your variable declaration long is correct, I was wrong, who cares, it was a quick and dirty hack this morning to support you).
Is this what you wanted?
You understood the thing with the ticks? The ticks value is a simple counter, started at 1.1.1970 0:00 GMT. Since then, it counts up +1 every millisecond.
So with DateTime.Now you can get the actual tick from your mobile and with all the other functions you can extract everything from it.
It becomes tricky, when you have to interpret a given time without ticks (coming from a database or whatever). Then you have to do a lot more work and to parse the given string. But B4X (B4A) will help you with strong parsing tools. Search for examples.
Simply enter DateTime. in your code and you will see the options.
DateTime.GetDayOfYear will give you probably that strange DDD-value (written in your post as "ddd"), a value between 1 and 366.
Ticks calculations make it very simple to calculate the intervals between two dates. You don't have to care about the length of a month, or leap day in february.
Keep in mind, this all is based on the gregorian calender, a de-facto worldwide standard. It may become eventually tricky to convert this to Suriyakati (traditional thai), Hidschra-Counting (islamic) or the hebrew calendar.