Lógica para converter um número inteiro para ANO/MÊS
Pessoal, Boa tarde.
Preciso de uma ajuda. Minha dúvida nem é na sintaxe em si, mas em lógica mesmo. Sozinho não to conseguindo resolver.
Preciso criar Arquivos com nome ("DC" + anoAtual + Mes). ex: DC201610, somar 1 ano se passar do mês 12 e ir incrementando o mês até 12
O usuário entra com 2 entradas.
O problema está se o usuário começa no mês 10 e precisa criar 5 meses(Arquivos) por exemplo.
Como deveria ficar: DC201610 Como ele está criando: DC201610
DC201611 DC201611
DC201612 DC201612
DC201701 DC201613
DC201702 DC201614
Alguém pode me ajudar? :wall:
Translation
Staff, Good afternoon.
I need help. My question is not in the syntax itself, but even in logic. Alone not getting to solve.
I need to create files with the name ("DC" + anoAtual + Mes). eg DC201610, add one year to spend the month 12 and go up to 12 incrementing the month
The user enters 2 entries.
I have to generate the files, and creating names. But it only works if the User of the beginning of the month month = January 01. because it goes to 12 and back to 01.
The problem is if the user begins the month 10 and need to create five months (Files) for example.
As it should be:
Pessoal, Boa tarde.
Preciso de uma ajuda. Minha dúvida nem é na sintaxe em si, mas em lógica mesmo. Sozinho não to conseguindo resolver.
Preciso criar Arquivos com nome ("DC" + anoAtual + Mes). ex: DC201610, somar 1 ano se passar do mês 12 e ir incrementando o mês até 12
O usuário entra com 2 entradas.
- Número de meses para gerar
- Mes de inicio de 1..12
O problema está se o usuário começa no mês 10 e precisa criar 5 meses(Arquivos) por exemplo.
Como deveria ficar: DC201610 Como ele está criando: DC201610
DC201611 DC201611
DC201612 DC201612
DC201701 DC201613
DC201702 DC201614
Alguém pode me ajudar? :wall:
Translation
Staff, Good afternoon.
I need help. My question is not in the syntax itself, but even in logic. Alone not getting to solve.
I need to create files with the name ("DC" + anoAtual + Mes). eg DC201610, add one year to spend the month 12 and go up to 12 incrementing the month
The user enters 2 entries.
- Number of months to generate
- Start Month 1..12
I have to generate the files, and creating names. But it only works if the User of the beginning of the month month = January 01. because it goes to 12 and back to 01.
The problem is if the user begins the month 10 and need to create five months (Files) for example.
As it should be:
Output:DC201610
DC201611
DC201612
DC201701
DC201702
as it is creating:Output:DC201610
DC201611
DC201612
DC201613
DC201614
Can someone help me? :wall: